Skip to content

Commit 81c3eca

Browse files
committed
wpt: update url & resources
1 parent c70b408 commit 81c3eca

26 files changed

+3593
-520
lines changed

test/common/wpt/worker.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const resource = new ResourceLoader(workerData.wptPath);
88

99
global.self = global;
1010
global.GLOBAL = {
11-
isWindow() { return false; }
11+
isWindow() { return false; },
12+
isShadowRealm() { return false; }
1213
};
1314
global.require = require;
1415

test/fixtures/wpt/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Last update:
2222
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/5873f2d8f1/html/webappapis/timers
2323
- interfaces: https://github.com/web-platform-tests/wpt/tree/fc086c82d5/interfaces
2424
- performance-timeline: https://github.com/web-platform-tests/wpt/tree/17ebc3aea0/performance-timeline
25-
- resources: https://github.com/web-platform-tests/wpt/tree/fbee645164/resources
25+
- resources: https://github.com/web-platform-tests/wpt/tree/c5b428f15a/resources
2626
- streams: https://github.com/web-platform-tests/wpt/tree/8f60d94439/streams
27-
- url: https://github.com/web-platform-tests/wpt/tree/77d54aa9e0/url
27+
- url: https://github.com/web-platform-tests/wpt/tree/0e5b126cd0/url
2828
- user-timing: https://github.com/web-platform-tests/wpt/tree/df24fb604e/user-timing
2929
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/1dd414c796/wasm/jsapi
3030
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Function that sends an accesskey using the proper key combination depending on the browser and OS.
3+
*
4+
* This needs that the test imports the following scripts:
5+
* <script src="/resources/testdriver.js"></script>
6+
* <script src="/resources/testdriver-actions.js"></script>
7+
* <script src="/resources/testdriver-vendor.js"></script>
8+
*/
9+
function pressAccessKey(accessKey){
10+
let controlKey = '\uE009'; // left Control key
11+
let altKey = '\uE00A'; // left Alt key
12+
let optionKey = altKey; // left Option key
13+
let shiftKey = '\uE008'; // left Shift key
14+
// There are differences in using accesskey across browsers and OS's.
15+
// See: // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey
16+
let isMacOSX = navigator.userAgent.indexOf("Mac") != -1;
17+
let osAccessKey = isMacOSX ? [controlKey, optionKey] : [shiftKey, altKey];
18+
let actions = new test_driver.Actions();
19+
// Press keys.
20+
for (let key of osAccessKey) {
21+
actions = actions.keyDown(key);
22+
}
23+
actions = actions
24+
.keyDown(accessKey)
25+
.addTick()
26+
.keyUp(accessKey);
27+
osAccessKey.reverse();
28+
for (let key of osAccessKey) {
29+
actions = actions.keyUp(key);
30+
}
31+
return actions.send();
32+
}
33+
34+
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Blank Page</title>
6+
<script>
7+
window.onload = function(event) {
8+
// This is needed to ensure the onload event fires when this page is
9+
// opened as a popup.
10+
// See https://github.com/web-platform-tests/wpt/pull/18157
11+
};
12+
</script>
13+
</head>
14+
<body>
15+
</body>
16+
</html>

0 commit comments

Comments
 (0)