Skip to content

Commit

Permalink
wpt: update url & resources
Browse files Browse the repository at this point in the history
  • Loading branch information
F3n67u committed May 23, 2022
1 parent c70b408 commit 81c3eca
Show file tree
Hide file tree
Showing 26 changed files with 3,593 additions and 520 deletions.
3 changes: 2 additions & 1 deletion test/common/wpt/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const resource = new ResourceLoader(workerData.wptPath);

global.self = global;
global.GLOBAL = {
isWindow() { return false; }
isWindow() { return false; },
isShadowRealm() { return false; }
};
global.require = require;

Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ Last update:
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/5873f2d8f1/html/webappapis/timers
- interfaces: https://github.com/web-platform-tests/wpt/tree/fc086c82d5/interfaces
- performance-timeline: https://github.com/web-platform-tests/wpt/tree/17ebc3aea0/performance-timeline
- resources: https://github.com/web-platform-tests/wpt/tree/fbee645164/resources
- resources: https://github.com/web-platform-tests/wpt/tree/c5b428f15a/resources
- streams: https://github.com/web-platform-tests/wpt/tree/8f60d94439/streams
- url: https://github.com/web-platform-tests/wpt/tree/77d54aa9e0/url
- url: https://github.com/web-platform-tests/wpt/tree/0e5b126cd0/url
- user-timing: https://github.com/web-platform-tests/wpt/tree/df24fb604e/user-timing
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/1dd414c796/wasm/jsapi
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
Expand Down
34 changes: 34 additions & 0 deletions test/fixtures/wpt/resources/accesskey.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Function that sends an accesskey using the proper key combination depending on the browser and OS.
*
* This needs that the test imports the following scripts:
* <script src="/resources/testdriver.js"></script>
* <script src="/resources/testdriver-actions.js"></script>
* <script src="/resources/testdriver-vendor.js"></script>
*/
function pressAccessKey(accessKey){
let controlKey = '\uE009'; // left Control key
let altKey = '\uE00A'; // left Alt key
let optionKey = altKey; // left Option key
let shiftKey = '\uE008'; // left Shift key
// There are differences in using accesskey across browsers and OS's.
// See: // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
let isMacOSX = navigator.userAgent.indexOf("Mac") != -1;
let osAccessKey = isMacOSX ? [controlKey, optionKey] : [shiftKey, altKey];
let actions = new test_driver.Actions();
// Press keys.
for (let key of osAccessKey) {
actions = actions.keyDown(key);
}
actions = actions
.keyDown(accessKey)
.addTick()
.keyUp(accessKey);
osAccessKey.reverse();
for (let key of osAccessKey) {
actions = actions.keyUp(key);
}
return actions.send();
}


16 changes: 16 additions & 0 deletions test/fixtures/wpt/resources/blank.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Blank Page</title>
<script>
window.onload = function(event) {
// This is needed to ensure the onload event fires when this page is
// opened as a popup.
// See https://github.com/web-platform-tests/wpt/pull/18157
};
</script>
</head>
<body>
</body>
</html>

0 comments on commit 81c3eca

Please sign in to comment.