From f05c81363446d427dc38aa612cc929c44300066b Mon Sep 17 00:00:00 2001
From: WPT Sync Bot
Date: Sat, 9 May 2020 08:19:41 +0000
Subject: [PATCH] Update web-platform-tests to revision
3a7b40eb73bf5359adf0d378b71d36488885057f
---
.../url/url-in-tags-revoke.window.js.ini | 2 +-
.../CSS2/floats/hit-test-floats-002.html.ini | 4 -
.../CSS2/floats/hit-test-floats-005.html.ini | 4 -
.../transform-scale-hittest.html.ini | 3 +
...ryList-addListener-removeListener.html.ini | 3 -
.../cssom-view/elementFromPoint-001.html.ini | 4 +
.../elementsFromPoint-iframes.html.ini | 3 +
.../elementsFromPoint-invalid-cases.html.ini | 4 +
.../reactions/HTMLMediaElement.html.ini | 2 -
.../fetch/content-type/response.window.js.ini | 15 +-
.../fetch/content-type/script.window.js.ini | 3 -
.../nosniff/parsing-nosniff.window.js.ini | 5 +-
.../traverse_the_history_3.html.ini | 4 +
.../traverse_the_history_5.html.ini | 4 +
.../supported-elements.html.ini | 12 +-
...le-event-handler-settings-objects.html.ini | 3 -
.../events/event-handler-sourcetext.html.ini | 16 +
.../constructor-shared.tentative.any.js.ini | 9 +
.../wasm/jsapi/memory/grow.any.js.ini | 9 +
.../url/url-in-tags-revoke.window.js.ini | 2 +-
tests/wpt/metadata/MANIFEST.json | 525 +++++++++++++++---
.../CSS2/floats/hit-test-floats-002.html.ini | 4 -
.../CSS2/floats/hit-test-floats-005.html.ini | 4 -
.../transform-scale-hittest.html.ini | 3 +
...ryList-addListener-removeListener.html.ini | 3 -
.../cssom-view/elementFromPoint-001.html.ini | 4 +
.../elementsFromPoint-iframes.html.ini | 3 +
.../elementsFromPoint-invalid-cases.html.ini | 4 +
.../reactions/HTMLMediaElement.html.ini | 2 -
.../fetch/content-type/response.window.js.ini | 15 +-
.../fetch/content-type/script.window.js.ini | 3 -
.../nosniff/parsing-nosniff.window.js.ini | 5 +-
.../traverse_the_history_3.html.ini | 4 +
.../traverse_the_history_5.html.ini | 4 +
.../supported-elements.html.ini | 12 +-
...le-event-handler-settings-objects.html.ini | 3 -
.../events/event-handler-sourcetext.html.ini | 16 +
.../constructor-shared.tentative.any.js.ini | 9 +
.../wasm/jsapi/memory/grow.any.js.ini | 9 +
.../css/css-flexbox/grid-flex-item-003.html | 11 +
.../css/css-flexbox/grid-flex-item-004.html | 11 +
.../css/css-pseudo/marker-animate.html | 59 ++
.../block-aspect-ratio-009.tentative.html | 11 +
.../block-aspect-ratio-010.tentative.html | 13 +
.../block-aspect-ratio-011.tentative.html | 13 +
.../block-aspect-ratio-012.tentative.html | 13 +
.../block-aspect-ratio-013.tentative.html | 12 +
.../block-aspect-ratio-014.tentative.html | 11 +
.../flex-aspect-ratio-007.tentative.html | 2 +-
.../flex-aspect-ratio-008.tentative.html | 13 +
.../percentage-resolution-001.tentative.html | 11 +
.../percentage-resolution-002.tentative.html | 11 +
.../percentage-resolution-003.tentative.html | 11 +
.../percentage-resolution-004.tentative.html | 12 +
.../quirks-mode-001.tentative.html | 2 +-
.../quirks-mode-003.tentative.html | 15 +
.../reference/ref-square-with-scrollbar.html | 8 +
.../ref-square-with-vertical-scrollbar.html | 8 +
...ntrinsic-percent-replaced-dynamic-009.html | 14 +
...ntrinsic-percent-replaced-dynamic-010.html | 16 +
...mized-built-in-constructor-exceptions.html | 32 ++
.../fetch/metadata/preload.https.sub.html | 5 +-
.../events/event-handler-sourcetext.html | 40 ++
.../the-navigator-object/protocol.https.html | 55 +-
.../basics.tentative.https.window.js | 82 ++-
.../idle-detection/idle-detection.idl | 33 +-
.../idle-permission.tentative.https.window.js | 16 +-
.../idle-detection/idlharness.https.window.js | 3 +-
.../idle-detection/interceptor.https.html | 144 +++--
.../resources/idlharness-worker.js | 3 +-
.../resources/test-adapter.js | 2 +-
.../layout-instability/resources/util.js | 19 +
.../simple-block-movement.html | 8 +-
.../layout-instability/sources-enclosure.html | 62 +++
.../layout-instability/sources-maximpact.html | 73 +++
.../multiple-event-listeners.https.html | 30 +-
.../motion/null-values.https.html | 15 +-
.../orientation/absolute-fallback.https.html | 4 +-
.../basic-operation-absolute.https.html | 5 +-
.../orientation/basic-operation.https.html | 5 +-
.../multiple-event-listeners.https.html | 28 +-
.../orientation/null-values.https.html | 13 +-
.../orientation/updates.https.html | 10 +-
.../resources/orientation-event-helpers.js | 9 +
.../pointerevents/idlharness.window.js | 1 +
.../push-api/idlharness.https.any.js | 1 +
.../resources/chromium/webxr-test.js | 19 +-
.../getScreens.tentative.https.window.js | 11 +-
.../scroll-animation-inactive-timeline.html | 32 ++
.../scroll-animations/setting-start-time.html | 339 +++++++++++
.../secure-contexts/idlharness.any.js | 1 +
...imate-path-animation-Cc-Ss.tentative.html} | 49 +-
...te-path-animation-Ll-Vv-Hh.tentative.html} | 45 +-
.../animate-path-animation-Mm-Aa-Z.html | 65 ---
...mate-path-animation-Mm-Aa-Z.tentative.html | 62 +++
...imate-path-animation-Qq-Tt.tentative.html} | 45 +-
...th-animation-cC-sS-inverse.tentative.html} | 49 +-
...animation-lL-vV-hH-inverse.tentative.html} | 45 +-
...nimate-path-animation-mM-aA-Z-inverse.html | 65 ---
...h-animation-mM-aA-Z-inverse.tentative.html | 63 +++
...th-animation-qQ-tT-inverse.tentative.html} | 48 +-
... animate-path-to-animation.tentative.html} | 40 +-
.../support/animated-path-helpers.js | 76 +++
.../svg/animations/svgpath-animation-1.html | 67 ---
.../svgpath-animation-1.tentative.html | 55 ++
.../tools/ci/tc/tests/test_valid.py | 10 +-
.../wasm/jsapi/memory/assertions.js | 38 ++
.../constructor-shared.tentative.any.js | 54 ++
.../wasm/jsapi/memory/constructor.any.js | 73 +--
.../wasm/jsapi/memory/grow.any.js | 28 +-
.../webxr/resources/webxr_util.js | 47 +-
.../rendering/draw-buffers.html.ini | 6 +
112 files changed, 2238 insertions(+), 912 deletions(-)
delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini
delete mode 100644 tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini
create mode 100644 tests/wpt/metadata-layout-2020/css/cssom-view/elementFromPoint-001.html.ini
create mode 100644 tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini
delete mode 100644 tests/wpt/metadata-layout-2020/custom-elements/reactions/HTMLMediaElement.html.ini
create mode 100644 tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_3.html.ini
create mode 100644 tests/wpt/metadata-layout-2020/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini
create mode 100644 tests/wpt/metadata-layout-2020/html/webappapis/scripting/events/event-handler-sourcetext.html.ini
create mode 100644 tests/wpt/metadata-layout-2020/wasm/jsapi/memory/constructor-shared.tentative.any.js.ini
create mode 100644 tests/wpt/metadata-layout-2020/wasm/jsapi/memory/grow.any.js.ini
delete mode 100644 tests/wpt/metadata/css/CSS2/floats/hit-test-floats-002.html.ini
delete mode 100644 tests/wpt/metadata/css/CSS2/floats/hit-test-floats-005.html.ini
create mode 100644 tests/wpt/metadata/css/cssom-view/elementFromPoint-001.html.ini
create mode 100644 tests/wpt/metadata/css/cssom-view/elementsFromPoint-invalid-cases.html.ini
delete mode 100644 tests/wpt/metadata/custom-elements/reactions/HTMLMediaElement.html.ini
create mode 100644 tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_3.html.ini
create mode 100644 tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini
create mode 100644 tests/wpt/metadata/html/webappapis/scripting/events/event-handler-sourcetext.html.ini
create mode 100644 tests/wpt/metadata/wasm/jsapi/memory/constructor-shared.tentative.any.js.ini
create mode 100644 tests/wpt/metadata/wasm/jsapi/memory/grow.any.js.ini
create mode 100644 tests/wpt/web-platform-tests/css/css-flexbox/grid-flex-item-003.html
create mode 100644 tests/wpt/web-platform-tests/css/css-flexbox/grid-flex-item-004.html
create mode 100644 tests/wpt/web-platform-tests/css/css-pseudo/marker-animate.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-009.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-010.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-011.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-012.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-013.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/block-aspect-ratio-014.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/flex-aspect-ratio-008.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-001.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-002.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-003.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/percentage-resolution-004.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/quirks-mode-003.tentative.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/reference/ref-square-with-scrollbar.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/aspect-ratio/reference/ref-square-with-vertical-scrollbar.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-009.html
create mode 100644 tests/wpt/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html
create mode 100644 tests/wpt/web-platform-tests/html/webappapis/scripting/events/event-handler-sourcetext.html
create mode 100644 tests/wpt/web-platform-tests/layout-instability/sources-enclosure.html
create mode 100644 tests/wpt/web-platform-tests/layout-instability/sources-maximpact.html
create mode 100644 tests/wpt/web-platform-tests/scroll-animations/setting-start-time.html
rename tests/wpt/web-platform-tests/svg/animations/{animate-path-animation-Cc-Ss.html => animate-path-animation-Cc-Ss.tentative.html} (51%)
rename tests/wpt/web-platform-tests/svg/animations/{animate-path-animation-Ll-Vv-Hh.html => animate-path-animation-Ll-Vv-Hh.tentative.html} (52%)
delete mode 100644 tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Mm-Aa-Z.html
create mode 100644 tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Mm-Aa-Z.tentative.html
rename tests/wpt/web-platform-tests/svg/animations/{animate-path-animation-Qq-Tt.html => animate-path-animation-Qq-Tt.tentative.html} (52%)
rename tests/wpt/web-platform-tests/svg/animations/{animate-path-animation-cC-sS-inverse.html => animate-path-animation-cC-sS-inverse.tentative.html} (52%)
rename tests/wpt/web-platform-tests/svg/animations/{animate-path-animation-lL-vV-hH-inverse.html => animate-path-animation-lL-vV-hH-inverse.tentative.html} (53%)
delete mode 100644 tests/wpt/web-platform-tests/svg/animations/animate-path-animation-mM-aA-Z-inverse.html
create mode 100644 tests/wpt/web-platform-tests/svg/animations/animate-path-animation-mM-aA-Z-inverse.tentative.html
rename tests/wpt/web-platform-tests/svg/animations/{animate-path-animation-qQ-tT-inverse.html => animate-path-animation-qQ-tT-inverse.tentative.html} (51%)
rename tests/wpt/web-platform-tests/svg/animations/{animate-path-to-animation.html => animate-path-to-animation.tentative.html} (53%)
create mode 100644 tests/wpt/web-platform-tests/svg/animations/support/animated-path-helpers.js
delete mode 100644 tests/wpt/web-platform-tests/svg/animations/svgpath-animation-1.html
create mode 100644 tests/wpt/web-platform-tests/svg/animations/svgpath-animation-1.tentative.html
create mode 100644 tests/wpt/web-platform-tests/wasm/jsapi/memory/assertions.js
create mode 100644 tests/wpt/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js
diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini
index 3605e8f3fc99..76b44d9e9cf9 100644
--- a/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini
+++ b/tests/wpt/metadata-layout-2020/FileAPI/url/url-in-tags-revoke.window.js.ini
@@ -4,7 +4,7 @@
expected: TIMEOUT
[Opening a blob URL in a new window immediately before revoking it works.]
- expected: TIMEOUT
+ expected: FAIL
[Fetching a blob URL immediately before revoking it works in an iframe.]
expected: FAIL
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini
deleted file mode 100644
index f64b45fea6b5..000000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[hit-test-floats-002.html]
- [Hit test float]
- expected: FAIL
-
diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini
deleted file mode 100644
index baa9f1a7541b..000000000000
--- a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-005.html.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[hit-test-floats-005.html]
- [Miss clipped float]
- expected: FAIL
-
diff --git a/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini b/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini
index 4a1e8110f6fb..f8e7e539aae9 100644
--- a/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini
+++ b/tests/wpt/metadata-layout-2020/css/css-transforms/transform-scale-hittest.html.ini
@@ -2,3 +2,6 @@
[Hit test intersecting scaled box]
expected: FAIL
+ [Hit test within unscaled box]
+ expected: FAIL
+
diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini
index c884dc82eab6..628b1fab7703 100644
--- a/tests/wpt/metadata-layout-2020/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini
+++ b/tests/wpt/metadata-layout-2020/css/cssom-view/MediaQueryList-addListener-removeListener.html.ini
@@ -2,6 +2,3 @@
[listeners are called when
-
diff --git a/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.window.js b/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.window.js
index 2bb74fbcd2ae..8abbbb70b229 100644
--- a/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.window.js
+++ b/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.window.js
@@ -9,64 +9,90 @@ promise_setup(async t => {
})
promise_test(async t => {
- let status = new IdleDetector();
- let watcher = new EventWatcher(t, status, ["change"]);
+ let detector = new IdleDetector();
+ let watcher = new EventWatcher(t, detector, ["change"]);
let initial_state = watcher.wait_for("change");
- await status.start();
+ await detector.start();
await initial_state;
- assert_true(['active', 'idle'].includes(status.state.user),
- 'status has a valid user state');
- assert_true(['locked', 'unlocked'].includes(status.state.screen),
- 'status has a valid screen state');
+ assert_true(['active', 'idle'].includes(detector.userState),
+ 'has a valid user state');
+ assert_true(['locked', 'unlocked'].includes(detector.screenState),
+ 'has a valid screen state');
}, 'start() basics');
promise_test(async t => {
let used = false;
- new IdleDetector({
+ const detector = new IdleDetector();
+ detector.start({
get threshold() {
used = true;
return 60000;
}
});
- assert_true(used, 'constructor options "threshold" member was used');
-}, 'constructor uses threshold property');
+ assert_true(used, 'start() options "threshold" member was used');
+}, 'start() uses threshold property');
promise_test(async t => {
- assert_throws_js(TypeError, () => new IdleDetector({threshold: 0}));
-}, 'constructor throws with invalid threshold (0)');
+ let used = false;
+
+ const controller = new AbortController();
+ const detector = new IdleDetector();
+ detector.start({
+ get signal() {
+ used = true;
+ return controller.signal;
+ }
+ });
+
+ assert_true(used, 'start() options "signal" member was used');
+}, 'start() uses signal property');
+
+
+promise_test(async t => {
+ const detector = new IdleDetector();
+ await promise_rejects_js(t, TypeError, detector.start({threshold: 0}));
+}, 'start() rejects with invalid threshold (0)');
promise_test(async t => {
- assert_throws_js(TypeError, () => new IdleDetector({threshold: 59000}));
-}, 'constructor throws with threshold below minimum (59000)');
+ const detector = new IdleDetector();
+ await promise_rejects_js(t, TypeError, detector.start({threshold: 59000}));
+}, 'start() rejects with threshold below minimum (59000)');
promise_test(async t => {
- new IdleDetector({threshold: 60000});
-}, 'constructor allows threshold (60000)');
+ const detector = new IdleDetector();
+ await detector.start({threshold: 60000});
+}, 'start() rejects threshold (60000)');
promise_test(async t => {
- new IdleDetector({threshold: 61000});
-}, 'constructor allows threshold (61000)');
+ const detector = new IdleDetector();
+ await detector.start({threshold: 61000});
+}, 'start() allows threshold (61000)');
promise_test(async t => {
- assert_throws_js(TypeError, () => new IdleDetector({threshold: null}));
-}, 'constructor throws with invalid threshold (null)');
+ const detector = new IdleDetector();
+ await promise_rejects_js(t, TypeError, detector.start({threshold: null}));
+}, 'start() rejects with invalid threshold (null)');
promise_test(async t => {
- assert_throws_js(TypeError, () => new IdleDetector({threshold: -1}));
-}, 'constructor throws with invalid threshold (-1)');
+ const detector = new IdleDetector();
+ await promise_rejects_js(t, TypeError, detector.start({threshold: -1}));
+}, 'start() rejects with invalid threshold (-1)');
promise_test(async t => {
- assert_throws_js(TypeError, () => new IdleDetector({threshold: NaN}));
-}, 'constructor throws with invalid threshold (NaN)');
+ const detector = new IdleDetector();
+ await promise_rejects_js(t, TypeError, detector.start({threshold: NaN}));
+}, 'start() rejects with invalid threshold (NaN)');
promise_test(async t => {
- new IdleDetector();
-}, 'constructor uses a default value for the threshold when none is passed');
+ const detector = new IdleDetector();
+ await detector.start();
+}, 'start() uses a default value for the threshold when none is passed');
promise_test(async t => {
- new IdleDetector({threshold: undefined});
-}, 'constructor uses a default value for the threshold');
+ const detector = new IdleDetector();
+ await detector.start({threshold: undefined});
+}, 'start() uses a default value for the threshold');
diff --git a/tests/wpt/web-platform-tests/idle-detection/idle-detection.idl b/tests/wpt/web-platform-tests/idle-detection/idle-detection.idl
index 2b8ff2543c87..066e1ede78df 100644
--- a/tests/wpt/web-platform-tests/idle-detection/idle-detection.idl
+++ b/tests/wpt/web-platform-tests/idle-detection/idle-detection.idl
@@ -1,24 +1,6 @@
dictionary IdleOptions {
- [EnforceRange] unsigned long threshold = 60000;
-};
-
-[
- SecureContext,
- Constructor(optional IdleOptions options),
- Exposed=(Window,Worker)
-] interface IdleDetector : EventTarget {
- readonly attribute IdleState state;
- attribute EventHandler onchange;
- Promise start();
- void stop();
-};
-
-[
- SecureContext,
- Exposed=(Window,Worker)
-] interface IdleState {
- readonly attribute UserIdleState user;
- readonly attribute ScreenIdleState screen;
+ [EnforceRange] unsigned long threshold;
+ AbortSignal signal;
};
enum UserIdleState {
@@ -30,3 +12,14 @@ enum ScreenIdleState {
"locked",
"unlocked"
};
+
+[
+ SecureContext,
+ Exposed=(Window,Worker)
+] interface IdleDetector : EventTarget {
+ constructor();
+ readonly attribute UserIdleState? userState;
+ readonly attribute ScreenIdleState? screenState;
+ attribute EventHandler onchange;
+ Promise start(optional IdleOptions options = {});
+};
diff --git a/tests/wpt/web-platform-tests/idle-detection/idle-permission.tentative.https.window.js b/tests/wpt/web-platform-tests/idle-detection/idle-permission.tentative.https.window.js
index 502ba2ef3475..af83876821a6 100644
--- a/tests/wpt/web-platform-tests/idle-detection/idle-permission.tentative.https.window.js
+++ b/tests/wpt/web-platform-tests/idle-detection/idle-permission.tentative.https.window.js
@@ -6,19 +6,19 @@ promise_test(async t => {
await test_driver.set_permission(
{ name: 'notifications' }, 'denied', false);
- let status = new IdleDetector();
- await promise_rejects_dom(t, 'NotAllowedError', status.start());
+ let detector = new IdleDetector();
+ await promise_rejects_dom(t, 'NotAllowedError', detector.start());
}, "Deny notifications permission should work.");
promise_test(async t => {
await test_driver.set_permission(
{ name: 'notifications' }, 'granted', false);
- let status = new IdleDetector();
- await status.start();
+ let detector = new IdleDetector();
+ await detector.start();
- assert_true(['active', 'idle'].includes(status.state.user),
- 'status has a valid user state');
- assert_true(['locked', 'unlocked'].includes(status.state.screen),
- 'status has a valid screen state');
+ assert_true(['active', 'idle'].includes(detector.userState),
+ 'has a valid user state');
+ assert_true(['locked', 'unlocked'].includes(detector.screenState),
+ 'has a valid screen state');
}, "Grant notifications permission should work.");
diff --git a/tests/wpt/web-platform-tests/idle-detection/idlharness.https.window.js b/tests/wpt/web-platform-tests/idle-detection/idlharness.https.window.js
index 7b410e0c6c48..dec8fee98825 100644
--- a/tests/wpt/web-platform-tests/idle-detection/idlharness.https.window.js
+++ b/tests/wpt/web-platform-tests/idle-detection/idlharness.https.window.js
@@ -23,7 +23,7 @@ promise_test(async (t) => {
idl_array.add_dependency_idls(dom);
idl_array.add_dependency_idls(html);
- self.idle = new IdleDetector({threshold: 60000});
+ self.idle = new IdleDetector();
let watcher = new EventWatcher(t, self.idle, ["change"]);
let initial_state = watcher.wait_for("change");
await self.idle.start();
@@ -31,7 +31,6 @@ promise_test(async (t) => {
idl_array.add_objects({
IdleDetector: ['idle'],
- IdleState: ['idle.state']
});
idl_array.test();
diff --git a/tests/wpt/web-platform-tests/idle-detection/interceptor.https.html b/tests/wpt/web-platform-tests/idle-detection/interceptor.https.html
index 449c9c86aac9..31acf2829f2f 100644
--- a/tests/wpt/web-platform-tests/idle-detection/interceptor.https.html
+++ b/tests/wpt/web-platform-tests/idle-detection/interceptor.https.html
@@ -29,17 +29,18 @@
});
});
- let detector = new IdleDetector({threshold: 60000});
- let watcher = new EventWatcher(t, detector, ["change"]);
- let initial_state = watcher.wait_for("change");
+ const controller = new AbortController();
+ const detector = new IdleDetector();
+ const watcher = new EventWatcher(t, detector, ["change"]);
+ const initial_state = watcher.wait_for("change");
- await detector.start();
+ await detector.start({ signal: controller.signal });
await initial_state;
- assert_equals(detector.state.user, "active");
- assert_equals(detector.state.screen, "locked");
+ assert_equals(detector.userState, "active");
+ assert_equals(detector.screenState, "locked");
- detector.stop();
+ controller.abort();
}, 'start()');
promise_test(async t => {
@@ -63,20 +64,21 @@
return first;
});
- let detector = new IdleDetector({threshold: 60000});
- let watcher = new EventWatcher(t, detector, ["change"]);
- let initial_state = watcher.wait_for("change");
+ const controller = new AbortController();
+ const detector = new IdleDetector();
+ const watcher = new EventWatcher(t, detector, ["change"]);
+ const initial_state = watcher.wait_for("change");
- await detector.start();
+ await detector.start({ signal: controller.signal });
await initial_state;
// Wait for the first change in state.
await watcher.wait_for("change");
- assert_equals(detector.state.user, "idle");
- assert_equals(detector.state.screen, "unlocked");
+ assert_equals(detector.userState, "idle");
+ assert_equals(detector.screenState, "unlocked");
- detector.stop();
+ controller.abort();
}, 'updates once');
@@ -108,22 +110,23 @@
return first;
});
- let detector = new IdleDetector({threshold: 60000});
- let watcher = new EventWatcher(t, detector, ["change"]);
- let initial_state = watcher.wait_for("change");
+ const controller = new AbortController();
+ const detector = new IdleDetector();
+ const watcher = new EventWatcher(t, detector, ["change"]);
+ const initial_state = watcher.wait_for("change");
- await detector.start();
+ await detector.start({ signal: controller.signal });
await initial_state;
// Waits for the first event.
await watcher.wait_for("change");
- assert_equals(detector.state.user, "idle");
+ assert_equals(detector.userState, "idle");
// Waits for the second event.
await watcher.wait_for("change");
- assert_equals(detector.state.user, "active");
+ assert_equals(detector.userState, "active");
- detector.stop();
+ controller.abort();
}, 'updates twice');
promise_test(async t => {
@@ -137,16 +140,17 @@
});
});
- let detector = new IdleDetector({threshold: 60000});
- let watcher = new EventWatcher(t, detector, ["change"]);
- let initial_state = watcher.wait_for("change");
+ const controller = new AbortController();
+ const detector = new IdleDetector();
+ const watcher = new EventWatcher(t, detector, ["change"]);
+ const initial_state = watcher.wait_for("change");
- await detector.start();
+ await detector.start({ signal: controller.signal });
await initial_state;
- assert_equals(detector.state.screen, "locked");
+ assert_equals(detector.screenState, "locked");
- detector.stop();
+ controller.abort();
}, 'locked screen');
promise_test(async t => {
@@ -159,21 +163,22 @@
});
});
- let detector = new IdleDetector({threshold: 60000});
+ const controller = new AbortController();
+ const detector = new IdleDetector();
let event = new Promise((resolve, reject) => {
detector.onchange = resolve;
});
- await detector.start();
+ await detector.start({ signal: controller.signal });
// Waits for the first event.
await event;
- assert_equals(detector.state.user, "active");
- assert_equals(detector.state.screen, "locked");
+ assert_equals(detector.userState, "active");
+ assert_equals(detector.screenState, "locked");
- detector.stop();
+ controller.abort();
}, 'IdleDetector.onchange');
promise_test(async t => {
@@ -186,30 +191,26 @@
});
});
- let detector = new IdleDetector({threshold: 60000});
+ const controller = new AbortController();
+ const detector = new IdleDetector();
- let watcher = new EventWatcher(t, detector, ["change"]);
- let initial_state = watcher.wait_for("change");
+ const watcher = new EventWatcher(t, detector, ["change"]);
+ const initial_state = watcher.wait_for("change");
- // Calling start() multiple times should be safe.
- await Promise.all([
- detector.start(),
- detector.start(),
- detector.start(),
- detector.start()
- ]);
+ // Only the first call to start() is allowed.
+ const start_promise = detector.start();
+ await promise_rejects_dom(t, 'InvalidStateError', detector.start());
+ await start_promise;
await initial_state;
- assert_equals(detector.state.user, "active");
- assert_equals(detector.state.screen, "unlocked");
-
- // Calling stop() multiple times should be safe.
- await Promise.all([
- detector.stop(),
- detector.stop(),
- detector.stop(),
- detector.stop()
- ]);
+ assert_equals(detector.userState, "active");
+ assert_equals(detector.screenState, "unlocked");
+
+ // Calling abort() multiple times is safe.
+ controller.abort();
+ controller.abort();
+ controller.abort();
+ controller.abort();
}, 'Safe to call start() or stop() multiple times');
promise_test(async t => {
@@ -222,21 +223,14 @@
});
});
- let detector = new IdleDetector({threshold: 60000});
-
- // Calling stop() before start() is a no-op.
- detector.stop();
+ const controller = new AbortController();
+ const detector = new IdleDetector();
- let watcher = new EventWatcher(t, detector, ["change"]);
- let initial_state = watcher.wait_for("change");
-
- await detector.start();
- await initial_state;
+ // Calling abort() before start() causes start() to fail.
+ controller.abort();
- assert_equals(detector.state.user, "active");
- assert_equals(detector.state.screen, "unlocked");
-
- detector.stop();
+ await promise_rejects_dom(
+ t, 'AbortError', detector.start({ signal: controller.signal }));
}, 'Calling stop() after start() is a no-op');
promise_test(async t => {
@@ -249,15 +243,15 @@
});
});
- let detector = new IdleDetector({threshold: 60000});
-
- let watcher = new EventWatcher(t, detector, ["change"]);
+ let controller = new AbortController();
+ const detector = new IdleDetector();
+ const watcher = new EventWatcher(t, detector, ["change"]);
let initial_state = watcher.wait_for("change");
- await detector.start();
+ await detector.start({ signal: controller.signal });
await initial_state;
- detector.stop();
+ controller.abort();
expect(addMonitor).andReturn((threshold, monitorPtr) => {
return Promise.resolve({
@@ -269,13 +263,15 @@
});
// Restarting the monitor.
+ controller = new AbortController();
+
initial_state = watcher.wait_for("change");
- await detector.start();
+ await detector.start({ signal: controller.signal });
await initial_state;
- assert_equals(detector.state.user, "idle");
- assert_equals(detector.state.screen, "locked");
+ assert_equals(detector.userState, "idle");
+ assert_equals(detector.screenState, "locked");
- detector.stop();
+ controller.abort();
}, 'Calling start() after stop(): re-starting monitor.');
diff --git a/tests/wpt/web-platform-tests/idle-detection/resources/idlharness-worker.js b/tests/wpt/web-platform-tests/idle-detection/resources/idlharness-worker.js
index a37d2273931e..6527dc45525a 100644
--- a/tests/wpt/web-platform-tests/idle-detection/resources/idlharness-worker.js
+++ b/tests/wpt/web-platform-tests/idle-detection/resources/idlharness-worker.js
@@ -7,7 +7,7 @@ idl_test(
['../idle-detection/idle-detection'],
['dom', 'html'],
async (idl_array, t) => {
- self.idle = new IdleDetector({threshold: 60000});
+ self.idle = new IdleDetector();
let watcher = new EventWatcher(t, self.idle, ["change"]);
let initial_state = watcher.wait_for("change");
await self.idle.start();
@@ -15,7 +15,6 @@ idl_test(
idl_array.add_objects({
IdleDetector: ['idle'],
- IdleState: ['idle.state']
});
}
);
diff --git a/tests/wpt/web-platform-tests/layout-instability/resources/test-adapter.js b/tests/wpt/web-platform-tests/layout-instability/resources/test-adapter.js
index 7a3d2c20b831..3272790f7ae5 100644
--- a/tests/wpt/web-platform-tests/layout-instability/resources/test-adapter.js
+++ b/tests/wpt/web-platform-tests/layout-instability/resources/test-adapter.js
@@ -1,5 +1,5 @@
// Abstracts expectations for reuse in different test frameworks.
cls_expect = (watcher, expectation) => {
- assert_equals(watcher.score, expectation.score);
+ watcher.checkExpectation(expectation);
};
diff --git a/tests/wpt/web-platform-tests/layout-instability/resources/util.js b/tests/wpt/web-platform-tests/layout-instability/resources/util.js
index 2ef971ddb791..8a06d72bb663 100644
--- a/tests/wpt/web-platform-tests/layout-instability/resources/util.js
+++ b/tests/wpt/web-platform-tests/layout-instability/resources/util.js
@@ -68,3 +68,22 @@ ScoreWatcher = function() {
});
observer.observe({entryTypes: ['layout-shift']});
};
+
+ScoreWatcher.prototype.checkExpectation = function(expectation) {
+ if (expectation.score)
+ assert_equals(this.score, expectation.score);
+ if (expectation.sources)
+ check_sources(expectation.sources, this.lastEntry.sources);
+};
+
+check_sources = (expect_sources, actual_sources) => {
+ assert_equals(expect_sources.length, actual_sources.length);
+ let rect_match = (e, a) =>
+ e[0] == a.x && e[1] == a.y && e[2] == a.width && e[3] == a.height;
+ let match = e => a =>
+ e.node === a.node &&
+ rect_match(e.previousRect, a.previousRect) &&
+ rect_match(e.currentRect, a.currentRect);
+ for (let e of expect_sources)
+ assert_true(actual_sources.some(match(e)), e.node + " not found");
+};
diff --git a/tests/wpt/web-platform-tests/layout-instability/simple-block-movement.html b/tests/wpt/web-platform-tests/layout-instability/simple-block-movement.html
index 533f85a68e68..aafc869a274e 100644
--- a/tests/wpt/web-platform-tests/layout-instability/simple-block-movement.html
+++ b/tests/wpt/web-platform-tests/layout-instability/simple-block-movement.html
@@ -1,14 +1,14 @@
Layout Instability: simple block movement is detected
-
-
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/layout-instability/sources-maximpact.html b/tests/wpt/web-platform-tests/layout-instability/sources-maximpact.html
new file mode 100644
index 000000000000..497932b065e1
--- /dev/null
+++ b/tests/wpt/web-platform-tests/layout-instability/sources-maximpact.html
@@ -0,0 +1,73 @@
+
+Layout Instability: source attribution prioritization
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/orientation-event/motion/multiple-event-listeners.https.html b/tests/wpt/web-platform-tests/orientation-event/motion/multiple-event-listeners.https.html
index 207fdd2d9c00..3b13d632ac8a 100644
--- a/tests/wpt/web-platform-tests/orientation-event/motion/multiple-event-listeners.https.html
+++ b/tests/wpt/web-platform-tests/orientation-event/motion/multiple-event-listeners.https.html
@@ -11,32 +11,16 @@
const motionData1 = generateMotionData(1, 2, 3,
4, 5, 6,
7, 8, 9);
+ setMockMotionData(sensorProvider, motionData1);
+ await Promise.all([
+ waitForEvent(getExpectedMotionEvent(motionData1)),
+ waitForEvent(getExpectedMotionEvent(motionData1))
+ ]);
+
const motionData2 = generateMotionData(11, 12, 13,
14, 15, 16,
17, 18, 19);
-
- let firstListener = null;
- let firstEventPromise = new Promise(resolve => {
- firstListener = resolve;
- });
- // We directly add the listener instead of using EventWatcher
- // because we want to remove listener after the first event fires
- // but EventWatcher could only stop watching after test done.
- window.addEventListener('devicemotion', firstListener);
-
- const watcher = new EventWatcher(t, window, ['devicemotion']);
- setMockMotionData(sensorProvider, motionData1);
-
- let firstEvent = await firstEventPromise;
- assertEventEquals(firstEvent, getExpectedMotionEvent(motionData1));
- let secondEvent = await watcher.wait_for('devicemotion');
- assertEventEquals(secondEvent, getExpectedMotionEvent(motionData1));
-
- window.removeEventListener('devicemotion', firstListener);
-
- // At this point only the second event listener is active.
setMockMotionData(sensorProvider, motionData2);
- let thirdEvent = await watcher.wait_for('devicemotion');
- assertEventEquals(thirdEvent, getExpectedMotionEvent(motionData2));
+ await waitForEvent(getExpectedMotionEvent(motionData2));
}, 'Tests using multiple event handlers for the Device Motion API.');
diff --git a/tests/wpt/web-platform-tests/orientation-event/motion/null-values.https.html b/tests/wpt/web-platform-tests/orientation-event/motion/null-values.https.html
index a6035543ba45..b6a2a1622fe0 100644
--- a/tests/wpt/web-platform-tests/orientation-event/motion/null-values.https.html
+++ b/tests/wpt/web-platform-tests/orientation-event/motion/null-values.https.html
@@ -24,21 +24,16 @@
null, null, null,
null, null, null);
- const watcher = new EventWatcher(t, window, ['devicemotion']);
setMockMotionData(sensorProvider, motionData1);
- const firstEvent = await watcher.wait_for('devicemotion');
- assertEventEquals(firstEvent, getExpectedMotionEvent(motionData1));
+ await waitForEvent(getExpectedMotionEvent(motionData1));
setMockMotionData(sensorProvider, motionData2);
- const secondEvent = await watcher.wait_for('devicemotion');
- assertEventEquals(secondEvent, getExpectedMotionEvent(motionData2));
+ await waitForEvent(getExpectedMotionEvent(motionData2));
setMockMotionData(sensorProvider, motionData3);
- const thirdEvent = await watcher.wait_for('devicemotion');
- assertEventEquals(thirdEvent, getExpectedMotionEvent(motionData3));
+ await waitForEvent(getExpectedMotionEvent(motionData3));
setMockMotionData(sensorProvider, motionData4);
- const fourthEvent = await watcher.wait_for('devicemotion');
- assertEventEquals(fourthEvent, getExpectedMotionEvent(motionData4));
+ await waitForEvent(getExpectedMotionEvent(motionData4));
}, 'Tests using null values for some or all of the event properties.');
-
\ No newline at end of file
+
diff --git a/tests/wpt/web-platform-tests/orientation-event/orientation/absolute-fallback.https.html b/tests/wpt/web-platform-tests/orientation-event/orientation/absolute-fallback.https.html
index 835d2441b358..610b1b3c5643 100644
--- a/tests/wpt/web-platform-tests/orientation-event/orientation/absolute-fallback.https.html
+++ b/tests/wpt/web-platform-tests/orientation-event/orientation/absolute-fallback.https.html
@@ -9,13 +9,11 @@
sensor_test(async (t, sensorProvider) => {
const orientationData = generateOrientationData(1.1, 2.2, 3.3, true);
- const watcher = new EventWatcher(t, window, ['deviceorientation']);
// Make the relative orientation sensor unavailable and set mock data for
// the absolute one.
sensorProvider.setGetSensorShouldFail('RelativeOrientationEulerAngles', true);
setMockOrientationData(sensorProvider, orientationData);
- const event = await watcher.wait_for('deviceorientation');
- assertEventEquals(event, getExpectedOrientationEvent(orientationData));
+ return waitForEvent(getExpectedAbsoluteOrientationEvent(orientationData));
}, 'Tests that deviceorientation falls back to using absolute orientation data if relative is unavailable.');
diff --git a/tests/wpt/web-platform-tests/orientation-event/orientation/basic-operation-absolute.https.html b/tests/wpt/web-platform-tests/orientation-event/orientation/basic-operation-absolute.https.html
index 05ac82cd35f3..61fd218781df 100644
--- a/tests/wpt/web-platform-tests/orientation-event/orientation/basic-operation-absolute.https.html
+++ b/tests/wpt/web-platform-tests/orientation-event/orientation/basic-operation-absolute.https.html
@@ -9,11 +9,8 @@
sensor_test(async (t, sensorProvider) => {
const orientationData = generateOrientationData(1.1, 2.2, 3.3, true);
- const watcher = new EventWatcher(t, window, ['deviceorientationabsolute']);
-
setMockOrientationData(sensorProvider, orientationData);
- const event = await watcher.wait_for('deviceorientationabsolute');
- assertEventEquals(event, getExpectedAbsoluteOrientationEvent(orientationData));
+ return waitForEvent(getExpectedAbsoluteOrientationEvent(orientationData));
}, 'Tests basic operation of deviceorientationabsolute event using mock data.');
sensor_test(async (t, sensorProvider) => {
diff --git a/tests/wpt/web-platform-tests/orientation-event/orientation/basic-operation.https.html b/tests/wpt/web-platform-tests/orientation-event/orientation/basic-operation.https.html
index 3806ee0792ae..45fe38006ea2 100644
--- a/tests/wpt/web-platform-tests/orientation-event/orientation/basic-operation.https.html
+++ b/tests/wpt/web-platform-tests/orientation-event/orientation/basic-operation.https.html
@@ -9,11 +9,8 @@
sensor_test(async (t, sensorProvider) => {
const orientationData = generateOrientationData(1.1, 2.2, 3.3, false);
- const watcher = new EventWatcher(t, window, ['deviceorientation']);
-
setMockOrientationData(sensorProvider, orientationData);
- const event = await watcher.wait_for('deviceorientation');
- assertEventEquals(event, getExpectedOrientationEvent(orientationData));
+ return waitForEvent(getExpectedOrientationEvent(orientationData));
}, 'Tests basic operation of deviceorientation event using mock data.');
sensor_test(async (t, sensorProvider) => {
diff --git a/tests/wpt/web-platform-tests/orientation-event/orientation/multiple-event-listeners.https.html b/tests/wpt/web-platform-tests/orientation-event/orientation/multiple-event-listeners.https.html
index 13d05f0c745f..473b7f88284b 100644
--- a/tests/wpt/web-platform-tests/orientation-event/orientation/multiple-event-listeners.https.html
+++ b/tests/wpt/web-platform-tests/orientation-event/orientation/multiple-event-listeners.https.html
@@ -9,30 +9,14 @@
sensor_test(async (t, sensorProvider) => {
const orientationData1 = generateOrientationData(1, 2, 3, false);
- const orientationData2 = generateOrientationData(11, 12, 13, false);
-
- let firstListener = null;
- let firstEventPromise = new Promise(resolve => {
- firstListener = resolve;
- });
- // We directly add the listener instead of using EventWatcher
- // because we want to remove listener after the first event fires
- // but EventWatcher could only stop watching after test done.
- window.addEventListener('deviceorientation', firstListener);
-
- const watcher = new EventWatcher(t, window, ['deviceorientation']);
setMockOrientationData(sensorProvider, orientationData1);
+ await Promise.all([
+ waitForEvent(getExpectedOrientationEvent(orientationData1)),
+ waitForEvent(getExpectedOrientationEvent(orientationData1))
+ ]);
- let firstEvent = await firstEventPromise;
- assertEventEquals(firstEvent, getExpectedOrientationEvent(orientationData1));
- let secondEvent = await watcher.wait_for('deviceorientation');
- assertEventEquals(secondEvent, getExpectedOrientationEvent(orientationData1));
-
- window.removeEventListener('deviceorientation', firstListener);
- // At this point only the second event listener is still active.
+ const orientationData2 = generateOrientationData(11, 12, 13, false);
setMockOrientationData(sensorProvider, orientationData2);
-
- let thirdEvent = await watcher.wait_for('deviceorientation');
- assertEventEquals(thirdEvent, getExpectedOrientationEvent(orientationData2));
+ await waitForEvent(getExpectedOrientationEvent(orientationData2));
}, 'Tests using multiple event handlers for the Device Orientation API.');
diff --git a/tests/wpt/web-platform-tests/orientation-event/orientation/null-values.https.html b/tests/wpt/web-platform-tests/orientation-event/orientation/null-values.https.html
index 55039ea2763b..f9e4aa642052 100644
--- a/tests/wpt/web-platform-tests/orientation-event/orientation/null-values.https.html
+++ b/tests/wpt/web-platform-tests/orientation-event/orientation/null-values.https.html
@@ -15,21 +15,16 @@
// will stop updating the sensor when it sees a null event.
const orientationData4 = generateOrientationData(null, null, null, false);
- const watcher = new EventWatcher(t, window, ['deviceorientation']);
setMockOrientationData(sensorProvider, orientationData1);
- const firstEvent = await watcher.wait_for('deviceorientation');
- assertEventEquals(firstEvent, getExpectedOrientationEvent(orientationData1));
+ await waitForEvent(getExpectedOrientationEvent(orientationData1));
setMockOrientationData(sensorProvider, orientationData2);
- const secondEvent = await watcher.wait_for('deviceorientation');
- assertEventEquals(secondEvent, getExpectedOrientationEvent(orientationData2));
+ await waitForEvent(getExpectedOrientationEvent(orientationData2));
setMockOrientationData(sensorProvider, orientationData3);
- const thirdEvent = await watcher.wait_for('deviceorientation');
- assertEventEquals(thirdEvent, getExpectedOrientationEvent(orientationData3));
+ await waitForEvent(getExpectedOrientationEvent(orientationData3));
setMockOrientationData(sensorProvider, orientationData4);
- const fourthEvent = await watcher.wait_for('deviceorientation');
- assertEventEquals(fourthEvent, getExpectedOrientationEvent(orientationData4));
+ await waitForEvent(getExpectedOrientationEvent(orientationData4));
}, 'Tests using null values for some of the event properties.');
diff --git a/tests/wpt/web-platform-tests/orientation-event/orientation/updates.https.html b/tests/wpt/web-platform-tests/orientation-event/orientation/updates.https.html
index de203da0a3af..c84588d5985d 100644
--- a/tests/wpt/web-platform-tests/orientation-event/orientation/updates.https.html
+++ b/tests/wpt/web-platform-tests/orientation-event/orientation/updates.https.html
@@ -9,15 +9,11 @@
sensor_test(async (t, sensorProvider) => {
const orientationData1 = generateOrientationData(1.1, 2.2, 3.3, false);
- const orientationData2 = generateOrientationData(11.1, 22.2, 33.3, false);
-
- const watcher = new EventWatcher(t, window, ['deviceorientation']);
setMockOrientationData(sensorProvider, orientationData1);
- const firstEvent = await watcher.wait_for('deviceorientation');
- assertEventEquals(firstEvent, getExpectedOrientationEvent(orientationData1));
+ await waitForEvent(getExpectedOrientationEvent(orientationData1));
+ const orientationData2 = generateOrientationData(11.1, 22.2, 33.3, false);
setMockOrientationData(sensorProvider, orientationData2);
- const secondEvent = await watcher.wait_for('deviceorientation');
- assertEventEquals(secondEvent, getExpectedOrientationEvent(orientationData2));
+ await waitForEvent(getExpectedOrientationEvent(orientationData2));
}, 'Tests that updates to the orientation causes new events to fire.');
diff --git a/tests/wpt/web-platform-tests/orientation-event/resources/orientation-event-helpers.js b/tests/wpt/web-platform-tests/orientation-event/resources/orientation-event-helpers.js
index 3168b71c5ec6..84bfc5115f38 100644
--- a/tests/wpt/web-platform-tests/orientation-event/resources/orientation-event-helpers.js
+++ b/tests/wpt/web-platform-tests/orientation-event/resources/orientation-event-helpers.js
@@ -179,3 +179,12 @@ function getExpectedMotionEvent(expectedMotionData) {
interval: expectedMotionData.interval,
});
}
+
+function waitForEvent(expected_event) {
+ return new Promise(resolve => {
+ window.addEventListener(expected_event.type, (event) => {
+ assertEventEquals(event, expected_event);
+ resolve();
+ }, { once: true });
+ });
+}
diff --git a/tests/wpt/web-platform-tests/pointerevents/idlharness.window.js b/tests/wpt/web-platform-tests/pointerevents/idlharness.window.js
index 90e812598256..b41a65f3ed0e 100644
--- a/tests/wpt/web-platform-tests/pointerevents/idlharness.window.js
+++ b/tests/wpt/web-platform-tests/pointerevents/idlharness.window.js
@@ -1,5 +1,6 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
+// META: timeout=long
'use strict';
diff --git a/tests/wpt/web-platform-tests/push-api/idlharness.https.any.js b/tests/wpt/web-platform-tests/push-api/idlharness.https.any.js
index 16c0826a7592..c0e278eb5742 100644
--- a/tests/wpt/web-platform-tests/push-api/idlharness.https.any.js
+++ b/tests/wpt/web-platform-tests/push-api/idlharness.https.any.js
@@ -2,6 +2,7 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
+// META: timeout=long
// https://w3c.github.io/push-api/
diff --git a/tests/wpt/web-platform-tests/resources/chromium/webxr-test.js b/tests/wpt/web-platform-tests/resources/chromium/webxr-test.js
index 7d4ad809bfd3..4809ac86bd3e 100644
--- a/tests/wpt/web-platform-tests/resources/chromium/webxr-test.js
+++ b/tests/wpt/web-platform-tests/resources/chromium/webxr-test.js
@@ -1527,21 +1527,4 @@ class MockXRPresentationProvider {
}
}
-// This is a temporary workaround for the fact that spinning up webxr before
-// the mojo interceptors are created will cause the interceptors to not get
-// registered, so we have to create this before we query xr;
-const XRTest = new ChromeXRTest();
-
-// This test API is also used to run Chrome's internal legacy VR tests; however,
-// those fail if navigator.xr has been used. Those tests will set a bool telling
-// us not to try to check navigator.xr
-if ((typeof legacy_vr_test === 'undefined') || !legacy_vr_test) {
- // Some tests may run in the http context where navigator.xr isn't exposed
- // This should just be to test that it isn't exposed, but don't try to set up
- // the test framework in this case.
- if (navigator.xr) {
- navigator.xr.test = XRTest;
- }
-} else {
- navigator.vr = { test: XRTest };
-}
+navigator.xr.test = new ChromeXRTest();
diff --git a/tests/wpt/web-platform-tests/screen_enumeration/getScreens.tentative.https.window.js b/tests/wpt/web-platform-tests/screen_enumeration/getScreens.tentative.https.window.js
index 14079b02c09a..76223b7907cd 100644
--- a/tests/wpt/web-platform-tests/screen_enumeration/getScreens.tentative.https.window.js
+++ b/tests/wpt/web-platform-tests/screen_enumeration/getScreens.tentative.https.window.js
@@ -1,4 +1,6 @@
// META: global=window,dedicatedworker,sharedworker,serviceworker
+// META: script=/resources/testdriver.js
+// META: script=/resources/testdriver-vendor.js
'use strict';
promise_test(async testCase => {
@@ -6,6 +8,7 @@ promise_test(async testCase => {
}, 'self.getScreens is present');
promise_test(async testCase => {
+ await test_driver.set_permission({name: 'window-placement'}, 'granted');
const screens = await self.getScreens();
assert_greater_than(screens.length, 0);
@@ -27,4 +30,10 @@ promise_test(async testCase => {
assert_equals(typeof screens[0].scaleFactor, 'number');
assert_equals(typeof screens[0].id, 'string');
assert_equals(typeof screens[0].touchSupport, 'boolean');
-}, 'self.getScreens returns at least 1 Screen');
+}, 'self.getScreens returns at least 1 Screen with permission granted');
+
+promise_test(async testCase => {
+ await test_driver.set_permission({name: 'window-placement'}, 'denied');
+ const screens = await self.getScreens();
+ assert_equals(screens.length, 0);
+}, 'self.getScreens returns no Screen objects with permission denied');
diff --git a/tests/wpt/web-platform-tests/scroll-animations/scroll-animation-inactive-timeline.html b/tests/wpt/web-platform-tests/scroll-animations/scroll-animation-inactive-timeline.html
index 07dae95692eb..1c0befa6943b 100644
--- a/tests/wpt/web-platform-tests/scroll-animations/scroll-animation-inactive-timeline.html
+++ b/tests/wpt/web-platform-tests/scroll-animations/scroll-animation-inactive-timeline.html
@@ -63,6 +63,38 @@
}, 'Animation start and current times are correct if scroll timeline is ' +
'activated after animation.play call.');
+promise_test(async t => {
+ const animation = createScrollLinkedAnimation(t);
+ const scroller = animation.timeline.scrollSource;
+ const target = animation.effect.target;
+ // Make the scroll timeline inactive.
+ scroller.style.overflow = 'visible';
+ // Wait for new animation frame which allows the timeline to compute new
+ // current time.
+ await waitForNextFrame();
+ // Set start time when the timeline is inactive.
+ animation.startTime = 0;
+ assert_equals(animation.currentTime, null,
+ 'Sanity check current time is unresolved when the timeline is inactive.');
+
+ // Make the scroll timeline active.
+ scroller.style.overflow = 'auto';
+ // Wait for new animation frame which allows the timeline to compute new
+ // current time.
+ await waitForNextFrame();
+
+ assert_equals(animation.currentTime, 0,
+ 'Animation current time is resolved when the timeline is active.');
+ assert_equals(animation.startTime, 0,
+ 'Animation start time is resolved.');
+ assert_times_equal(
+ animation.effect.getComputedTiming().localTime, 0,
+ 'Effect local time is resolved when the timeline is active.');
+ assert_equals(Number(getComputedStyle(target).opacity), 0,
+ 'Animation has an effect when the timeline is active.');
+}, 'Animation start and current times are correct if scroll timeline is ' +
+ 'activated after setting start time.');
+
promise_test(async t => {
const animation = createScrollLinkedAnimation(t);
const scroller = animation.timeline.scrollSource;
diff --git a/tests/wpt/web-platform-tests/scroll-animations/setting-start-time.html b/tests/wpt/web-platform-tests/scroll-animations/setting-start-time.html
new file mode 100644
index 000000000000..643f62a9b58b
--- /dev/null
+++ b/tests/wpt/web-platform-tests/scroll-animations/setting-start-time.html
@@ -0,0 +1,339 @@
+
+
+Setting the start time of scroll animation
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/secure-contexts/idlharness.any.js b/tests/wpt/web-platform-tests/secure-contexts/idlharness.any.js
index 5bd1d44d6f7d..396dfff1fdff 100644
--- a/tests/wpt/web-platform-tests/secure-contexts/idlharness.any.js
+++ b/tests/wpt/web-platform-tests/secure-contexts/idlharness.any.js
@@ -1,6 +1,7 @@
// META: global=window,worker
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
+// META: timeout=long
// https://w3c.github.io/webappsec-secure-contexts/
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Cc-Ss.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Cc-Ss.tentative.html
similarity index 51%
rename from tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Cc-Ss.html
rename to tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Cc-Ss.tentative.html
index 63c450a6c70c..69b3cc7af4cf 100644
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Cc-Ss.html
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Cc-Ss.tentative.html
@@ -1,24 +1,19 @@
-
-Test path animation where coordinate modes of start and end differ. You should see PASS messages
+Path animation where coordinate modes of start and end differ (C-c and S-s)
-
-
-
+
+
\ No newline at end of file
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Ll-Vv-Hh.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Ll-Vv-Hh.tentative.html
similarity index 52%
rename from tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Ll-Vv-Hh.html
rename to tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Ll-Vv-Hh.tentative.html
index 4f6d85421a64..8a1e2cb032f2 100644
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Ll-Vv-Hh.html
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Ll-Vv-Hh.tentative.html
@@ -1,24 +1,19 @@
-
-Test path animation where coordinate modes of start and end differ. You should see PASS messages
+Path animation where coordinate modes of start and end differ (L-l, V-v and H-h)
-
-
-
+
+
\ No newline at end of file
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Mm-Aa-Z.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Mm-Aa-Z.html
deleted file mode 100644
index 777ca3013757..000000000000
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Mm-Aa-Z.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-Test path animation where coordinate modes of start and end differ. You should see PASS messages
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Mm-Aa-Z.tentative.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Mm-Aa-Z.tentative.html
new file mode 100644
index 000000000000..fd0787792f85
--- /dev/null
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Mm-Aa-Z.tentative.html
@@ -0,0 +1,62 @@
+
+
+Path animation where coordinate modes of start and end differ (M-m, A-a and Z)
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Qq-Tt.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Qq-Tt.tentative.html
similarity index 52%
rename from tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Qq-Tt.html
rename to tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Qq-Tt.tentative.html
index d964303fa2de..e8b0ad8f71aa 100644
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Qq-Tt.html
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-Qq-Tt.tentative.html
@@ -1,24 +1,19 @@
-
-Test path animation where coordinate modes of start and end differ. You should see PASS messages
+Path animation where coordinate modes of start and end differ (Q-q and T-t)
-
-
-
+
+
\ No newline at end of file
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-cC-sS-inverse.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-cC-sS-inverse.tentative.html
similarity index 52%
rename from tests/wpt/web-platform-tests/svg/animations/animate-path-animation-cC-sS-inverse.html
rename to tests/wpt/web-platform-tests/svg/animations/animate-path-animation-cC-sS-inverse.tentative.html
index 709372706d87..5b19f69b2d2c 100644
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-cC-sS-inverse.html
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-cC-sS-inverse.tentative.html
@@ -1,24 +1,19 @@
-
-Test path animation where coordinate modes of start and end differ. You should see PASS messages
+Path animation where coordinate modes of start and end differ (c-C and s-S)
-
-
-
+
+
\ No newline at end of file
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-lL-vV-hH-inverse.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-lL-vV-hH-inverse.tentative.html
similarity index 53%
rename from tests/wpt/web-platform-tests/svg/animations/animate-path-animation-lL-vV-hH-inverse.html
rename to tests/wpt/web-platform-tests/svg/animations/animate-path-animation-lL-vV-hH-inverse.tentative.html
index a5c6e88a1b91..3a96eb294542 100644
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-lL-vV-hH-inverse.html
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-lL-vV-hH-inverse.tentative.html
@@ -1,24 +1,19 @@
-
-Test path animation where coordinate modes of start and end differ. You should see PASS messages
+Path animation where coordinate modes of start and end differ (l-L, v-V and h-H)
-
-
-
+
+
\ No newline at end of file
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-mM-aA-Z-inverse.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-mM-aA-Z-inverse.html
deleted file mode 100644
index 3e7e6e3199a1..000000000000
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-mM-aA-Z-inverse.html
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-Test path animation where coordinate modes of start and end differ. You should see PASS messages
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-mM-aA-Z-inverse.tentative.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-mM-aA-Z-inverse.tentative.html
new file mode 100644
index 000000000000..df32a4a2500f
--- /dev/null
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-mM-aA-Z-inverse.tentative.html
@@ -0,0 +1,63 @@
+
+
+
+Path animation where coordinate modes of start and end differ (m-M, a-A and Z)
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-qQ-tT-inverse.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-qQ-tT-inverse.tentative.html
similarity index 51%
rename from tests/wpt/web-platform-tests/svg/animations/animate-path-animation-qQ-tT-inverse.html
rename to tests/wpt/web-platform-tests/svg/animations/animate-path-animation-qQ-tT-inverse.tentative.html
index 85b98d4d5fee..6ae4d1f1dcd5 100644
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-qQ-tT-inverse.html
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-animation-qQ-tT-inverse.tentative.html
@@ -1,24 +1,19 @@
-
-Test path animation where coordinate modes of start and end differ. You should see PASS messages
+Path animation where coordinate modes of start and end differ (q-Q and t-T)
-
-
-
+
+
\ No newline at end of file
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/animate-path-to-animation.html b/tests/wpt/web-platform-tests/svg/animations/animate-path-to-animation.tentative.html
similarity index 53%
rename from tests/wpt/web-platform-tests/svg/animations/animate-path-to-animation.html
rename to tests/wpt/web-platform-tests/svg/animations/animate-path-to-animation.tentative.html
index 769113ce4907..a20a33f6a48c 100644
--- a/tests/wpt/web-platform-tests/svg/animations/animate-path-to-animation.html
+++ b/tests/wpt/web-platform-tests/svg/animations/animate-path-to-animation.tentative.html
@@ -1,24 +1,19 @@
-
-Test calcMode spline with to animation. You should see a green 100x100 path and only PASS messages
+calcMode spline with 'to' animation
-
-
-
+
+
\ No newline at end of file
+
diff --git a/tests/wpt/web-platform-tests/svg/animations/support/animated-path-helpers.js b/tests/wpt/web-platform-tests/svg/animations/support/animated-path-helpers.js
new file mode 100644
index 000000000000..3f6fffb9078b
--- /dev/null
+++ b/tests/wpt/web-platform-tests/svg/animations/support/animated-path-helpers.js
@@ -0,0 +1,76 @@
+function roundNumbers(value, digits) {
+ // Round numbers to |digits| decimal places.
+ return value.
+ replace(/-?\d*\.\d+(e-?\d+)?/g, function(n) {
+ return (parseFloat(n).toFixed(digits)).
+ replace(/\.\d+/, function(m) {
+ return m.replace(/0+$/, '');
+ }).
+ replace(/\.$/, '').
+ replace(/^-0$/, '0');
+ });
+}
+
+function normalizeValue(value, digits) {
+ // Round numbers and place whitespace between tokens.
+ return roundNumbers(value, digits).
+ replace(/([\w\d.]+|[^\s])/g, '$1 ').
+ replace(/\s+/g, ' ');
+}
+
+// Transform a path seg list into a path string, rounding numbers to |digits|
+// decimal places.
+function serializePathSegList(list, digits) {
+ function segmentArguments(segment) {
+ const kCommandDescriptor = {
+ 'M': ['x', 'y'],
+ 'L': ['x', 'y'],
+ 'C': ['x1', 'y1', 'x2', 'y2', 'x', 'y'],
+ 'Q': ['x1', 'y1', 'x', 'y'],
+ 'S': ['x2', 'y2', 'x', 'y'],
+ 'T': ['x', 'y'],
+ 'A': ['r1', 'r2', 'angle', 'largeArcFlag', 'sweepFlag', 'x', 'y'],
+ 'H': ['x'],
+ 'V': ['y'],
+ 'Z': []
+ };
+ let command = segment.pathSegTypeAsLetter.toUpperCase();
+ return kCommandDescriptor[command].map(field => {
+ return Number(segment[field]).toFixed(digits);
+ });
+ }
+ return Array.from(list).map(segment => {
+ let command = segment.pathSegTypeAsLetter;
+ if (command === 'z')
+ command = 'Z';
+ return [command, ...segmentArguments(segment)].join(' ');
+ }).join(' ');
+}
+
+function normalizeProperty(path_string) {
+ let probePathElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ probePathElement.setAttribute('d', path_string);
+ document.documentElement.appendChild(probePathElement);
+ let string = getComputedStyle(probePathElement).getPropertyValue('d');
+ probePathElement.remove();
+ return string;
+}
+
+// Assert that the animated path data of |target| matches that of
+// |expected_path_string|. Numbers will be rounded to 2 decimal places.
+function assert_animated_path_equals(target, expected_path_string) {
+ const kDecimals = 2;
+ let expected, actual;
+ if ('animatedPathSegList' in target) {
+ let probePathElement = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ probePathElement.setAttribute('d', expected_path_string);
+ expected = serializePathSegList(probePathElement.pathSegList, kDecimals)
+ actual = serializePathSegList(target.animatedPathSegList, kDecimals);
+ } else if ('d' in target.style) {
+ expected = normalizeValue(normalizeProperty(expected_path_string), kDecimals);
+ actual = normalizeValue(getComputedStyle(target).getPropertyValue('d'), kDecimals);
+ } else {
+ assert_unreached('no animated path data');
+ }
+ assert_equals(actual, expected);
+}
diff --git a/tests/wpt/web-platform-tests/svg/animations/svgpath-animation-1.html b/tests/wpt/web-platform-tests/svg/animations/svgpath-animation-1.html
deleted file mode 100644
index 220130532e9f..000000000000
--- a/tests/wpt/web-platform-tests/svg/animations/svgpath-animation-1.html
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-Test 'by' animation on path. You should see a green 100x100 path and only PASS messages
-
-
-
-
-
-
-
diff --git a/tests/wpt/web-platform-tests/svg/animations/svgpath-animation-1.tentative.html b/tests/wpt/web-platform-tests/svg/animations/svgpath-animation-1.tentative.html
new file mode 100644
index 000000000000..3df821d7c310
--- /dev/null
+++ b/tests/wpt/web-platform-tests/svg/animations/svgpath-animation-1.tentative.html
@@ -0,0 +1,55 @@
+
+'by' path animation
+
+
+
+
+
+
diff --git a/tests/wpt/web-platform-tests/tools/ci/tc/tests/test_valid.py b/tests/wpt/web-platform-tests/tools/ci/tc/tests/test_valid.py
index 85c015e521a6..c0863dfb2f5a 100644
--- a/tests/wpt/web-platform-tests/tools/ci/tc/tests/test_valid.py
+++ b/tests/wpt/web-platform-tests/tools/ci/tc/tests/test_valid.py
@@ -42,11 +42,13 @@ def test_verify_payload():
"""Verify that the decision task produces tasks with a valid payload"""
from tools.ci.tc.decision import decide
- create_task_schema = requests.get(
- "https://raw.githubusercontent.com/taskcluster/taskcluster/blob/master/services/queue/schemas/v1/create-task-request.yml")
- create_task_schema = yaml.safe_load(create_task_schema.content)
+ r = requests.get("https://community-tc.services.mozilla.com/schemas/queue/v1/create-task-request.json")
+ r.raise_for_status()
+ create_task_schema = r.json()
- payload_schema = requests.get("https://raw.githubusercontent.com/taskcluster/docker-worker/master/schemas/v1/payload.json").json()
+ r = requests.get("https://raw.githubusercontent.com/taskcluster/taskcluster/master/workers/docker-worker/schemas/v1/payload.json")
+ r.raise_for_status()
+ payload_schema = r.json()
jobs = ["lint",
"manifest_upload",
diff --git a/tests/wpt/web-platform-tests/wasm/jsapi/memory/assertions.js b/tests/wpt/web-platform-tests/wasm/jsapi/memory/assertions.js
new file mode 100644
index 000000000000..b539513adcab
--- /dev/null
+++ b/tests/wpt/web-platform-tests/wasm/jsapi/memory/assertions.js
@@ -0,0 +1,38 @@
+function assert_ArrayBuffer(actual, { size=0, shared=false, detached=false }, message) {
+ // https://github.com/WebAssembly/spec/issues/840
+ // See https://github.com/whatwg/html/issues/5380 for why not `self.SharedArrayBuffer`
+ const isShared = !("isView" in actual.constructor);
+ assert_equals(isShared, shared, `${message}: constructor`);
+ const sharedString = shared ? "Shared" : "";
+ assert_equals(actual.toString(), `[object ${sharedString}ArrayBuffer]`, `${message}: toString()`);
+ assert_equals(Object.getPrototypeOf(actual).toString(), `[object ${sharedString}ArrayBuffer]`, `${message}: prototype toString()`);
+ if (detached) {
+ // https://github.com/tc39/ecma262/issues/678
+ let byteLength;
+ try {
+ byteLength = actual.byteLength;
+ } catch (e) {
+ byteLength = 0;
+ }
+ assert_equals(byteLength, 0, `${message}: detached size`);
+ } else {
+ assert_equals(actual.byteLength, 0x10000 * size, `${message}: size`);
+ if (size > 0) {
+ const array = new Uint8Array(actual);
+ assert_equals(array[0], 0, `${message}: first element`);
+ assert_equals(array[array.byteLength - 1], 0, `${message}: last element`);
+ }
+ }
+ assert_equals(Object.isFrozen(actual), shared, "buffer frozen");
+ assert_equals(Object.isExtensible(actual), !shared, "buffer extensibility");
+}
+
+function assert_Memory(memory, { size=0, shared=false }) {
+ assert_equals(Object.getPrototypeOf(memory), WebAssembly.Memory.prototype,
+ "prototype");
+ assert_true(Object.isExtensible(memory), "extensible");
+
+ // https://github.com/WebAssembly/spec/issues/840
+ assert_equals(memory.buffer, memory.buffer, "buffer should be idempotent");
+ assert_ArrayBuffer(memory.buffer, { size, shared });
+}
diff --git a/tests/wpt/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js b/tests/wpt/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js
new file mode 100644
index 000000000000..216fc4ca5559
--- /dev/null
+++ b/tests/wpt/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js
@@ -0,0 +1,54 @@
+// META: global=window,dedicatedworker,jsshell
+// META: script=/wasm/jsapi/assertions.js
+// META: script=/wasm/jsapi/memory/assertions.js
+
+test(() => {
+ assert_throws_js(TypeError, () => new WebAssembly.Memory({ "initial": 10, "shared": true }));
+}, "Shared memory without maximum");
+
+test(t => {
+ const order = [];
+
+ new WebAssembly.Memory({
+ get maximum() {
+ order.push("maximum");
+ return {
+ valueOf() {
+ order.push("maximum valueOf");
+ return 1;
+ },
+ };
+ },
+
+ get initial() {
+ order.push("initial");
+ return {
+ valueOf() {
+ order.push("initial valueOf");
+ return 1;
+ },
+ };
+ },
+
+ get shared() {
+ order.push("shared");
+ return {
+ valueOf: t.unreached_func("should not call shared valueOf"),
+ };
+ },
+ });
+
+ assert_array_equals(order, [
+ "initial",
+ "initial valueOf",
+ "maximum",
+ "maximum valueOf",
+ "shared",
+ ]);
+}, "Order of evaluation for descriptor (with shared)");
+
+test(() => {
+ const argument = { "initial": 4, "maximum": 10, shared: true };
+ const memory = new WebAssembly.Memory(argument);
+ assert_Memory(memory, { "size": 4, "shared": true });
+}, "Shared memory");
diff --git a/tests/wpt/web-platform-tests/wasm/jsapi/memory/constructor.any.js b/tests/wpt/web-platform-tests/wasm/jsapi/memory/constructor.any.js
index f505719d2c5e..6524c8acc490 100644
--- a/tests/wpt/web-platform-tests/wasm/jsapi/memory/constructor.any.js
+++ b/tests/wpt/web-platform-tests/wasm/jsapi/memory/constructor.any.js
@@ -1,26 +1,6 @@
// META: global=window,dedicatedworker,jsshell
// META: script=/wasm/jsapi/assertions.js
-
-function assert_Memory(memory, expected) {
- assert_equals(Object.getPrototypeOf(memory), WebAssembly.Memory.prototype,
- "prototype");
- assert_true(Object.isExtensible(memory), "extensible");
-
- // https://github.com/WebAssembly/spec/issues/840
- assert_equals(memory.buffer, memory.buffer, "buffer should be idempotent");
- const isShared = !!expected.shared;
- const bufferType = isShared ? self.SharedArrayBuffer : ArrayBuffer;
- assert_equals(Object.getPrototypeOf(memory.buffer), bufferType.prototype,
- 'prototype of buffer');
- assert_equals(memory.buffer.byteLength, 0x10000 * expected.size, "size of buffer");
- if (expected.size > 0) {
- const array = new Uint8Array(memory.buffer);
- assert_equals(array[0], 0, "first element of buffer");
- assert_equals(array[array.byteLength - 1], 0, "last element of buffer");
- }
- assert_equals(isShared, Object.isFrozen(memory.buffer), "buffer frozen");
- assert_not_equals(Object.isExtensible(memory.buffer), isShared, "buffer extensibility");
-}
+// META: script=/wasm/jsapi/memory/assertions.js
test(() => {
assert_function_name(WebAssembly.Memory, "Memory", "WebAssembly.Memory");
@@ -86,10 +66,6 @@ test(() => {
assert_throws_js(RangeError, () => new WebAssembly.Memory({ "initial": 10, "maximum": 9 }));
}, "Initial value exceeds maximum");
-test(() => {
- assert_throws_js(TypeError, () => new WebAssembly.Memory({ "initial": 10, "shared": true }));
-}, "Shared memory without maximum");
-
test(() => {
const proxy = new Proxy({}, {
has(o, x) {
@@ -135,47 +111,6 @@ test(() => {
]);
}, "Order of evaluation for descriptor");
-test(t => {
- const order = [];
-
- new WebAssembly.Memory({
- get maximum() {
- order.push("maximum");
- return {
- valueOf() {
- order.push("maximum valueOf");
- return 1;
- },
- };
- },
-
- get initial() {
- order.push("initial");
- return {
- valueOf() {
- order.push("initial valueOf");
- return 1;
- },
- };
- },
-
- get shared() {
- order.push("shared");
- return {
- valueOf: t.unreached_func("should not call shared valueOf"),
- };
- },
- });
-
- assert_array_equals(order, [
- "initial",
- "initial valueOf",
- "maximum",
- "maximum valueOf",
- "shared",
- ]);
-}, "Order of evaluation for descriptor (with shared)");
-
test(() => {
const argument = { "initial": 0 };
const memory = new WebAssembly.Memory(argument);
@@ -193,9 +128,3 @@ test(() => {
const memory = new WebAssembly.Memory(argument, {});
assert_Memory(memory, { "size": 0 });
}, "Stray argument");
-
-test(() => {
- const argument = { "initial": 4, "maximum": 10, shared: true };
- const memory = new WebAssembly.Memory(argument);
- assert_Memory(memory, { "size": 4, "shared": true });
-}, "Shared memory");
diff --git a/tests/wpt/web-platform-tests/wasm/jsapi/memory/grow.any.js b/tests/wpt/web-platform-tests/wasm/jsapi/memory/grow.any.js
index db9e7813617b..c511129491f4 100644
--- a/tests/wpt/web-platform-tests/wasm/jsapi/memory/grow.any.js
+++ b/tests/wpt/web-platform-tests/wasm/jsapi/memory/grow.any.js
@@ -1,31 +1,5 @@
// META: global=window,dedicatedworker,jsshell
-
-function assert_ArrayBuffer(actual, { size=0, shared=false, detached=false }, message) {
- // https://github.com/WebAssembly/spec/issues/840
- // See https://github.com/whatwg/html/issues/5380 for why not `self.SharedArrayBuffer`
- const isShared = !("isView" in actual.constructor);
- assert_equals(isShared, shared, `${message}: constructor`);
- const sharedString = shared ? "Shared" : "";
- assert_equals(actual.toString(), `[object ${sharedString}ArrayBuffer]`, `${message}: toString()`);
- assert_equals(Object.getPrototypeOf(actual).toString(), `[object ${sharedString}ArrayBuffer]`, `${message}: prototype toString()`);
- if (detached) {
- // https://github.com/tc39/ecma262/issues/678
- let byteLength;
- try {
- byteLength = actual.byteLength;
- } catch (e) {
- byteLength = 0;
- }
- assert_equals(byteLength, 0, `${message}: detached size`);
- } else {
- assert_equals(actual.byteLength, 0x10000 * size, `${message}: size`);
- if (size > 0) {
- const array = new Uint8Array(actual);
- assert_equals(array[0], 0, `${message}: first element`);
- assert_equals(array[array.byteLength - 1], 0, `${message}: last element`);
- }
- }
-}
+// META: script=/wasm/jsapi/memory/assertions.js
test(() => {
const argument = { "initial": 0 };
diff --git a/tests/wpt/web-platform-tests/webxr/resources/webxr_util.js b/tests/wpt/web-platform-tests/webxr/resources/webxr_util.js
index 7c157518755d..81dc3d620aa1 100644
--- a/tests/wpt/web-platform-tests/webxr/resources/webxr_util.js
+++ b/tests/wpt/web-platform-tests/webxr/resources/webxr_util.js
@@ -18,15 +18,25 @@ function xr_promise_test(name, func, properties) {
// Perform any required test setup:
xr_debug(name, 'setup');
- if (isChromiumBased) {
- // Chrome setup
- await loadChromiumResources;
- xr_debug = navigator.xr.test.Debug;
+ if (!navigator.xr.test) {
+ if (isChromiumBased) {
+ // Chrome setup
+ await loadChromiumResources();
+ } else if (isWebKitBased) {
+ // WebKit setup
+ await setupWebKitWebXRTestAPI();
+ }
}
- if (isWebKitBased) {
- // WebKit setup
- await setupWebKitWebXRTestAPI;
+ // Either the test api needs to be polyfilled and it's not set up above, or
+ // something happened to one of the known polyfills and it failed to be
+ // setup properly. Either way, the fact that xr_promise_test is being used
+ // means that the tests expect navigator.xr.test to be set. By rejecting now
+ // we can hopefully provide a clearer indication of what went wrong.
+ if (!navigator.xr.test) {
+ // We can't use assert_true here because it causes the wpt testharness
+ // to treat this as a test page and not as a test.
+ return Promise.reject("No navigator.xr.test object found, even after attempted load");
}
// Ensure that any devices are disconnected when done. If this were done in
@@ -175,13 +185,7 @@ function forEachWebxrObject(callback) {
}
// Code for loading test API in Chromium.
-let loadChromiumResources = Promise.resolve().then(() => {
- if (!isChromiumBased) {
- // Do nothing on non-Chromium-based browsers or when the Mojo bindings are
- // not present in the global namespace.
- return;
- }
-
+function loadChromiumResources() {
let chromiumResources = [
'/gen/layout_test_data/mojo/public/js/mojo_bindings.js',
'/gen/mojo/public/mojom/base/time.mojom.js',
@@ -217,18 +221,17 @@ let loadChromiumResources = Promise.resolve().then(() => {
document.head.appendChild(script);
});
- return chain;
-});
+ chain = chain.then(() => {
+ xr_debug = navigator.xr.test.Debug;
+ });
-let setupWebKitWebXRTestAPI = Promise.resolve().then(() => {
- if (!isWebKitBased) {
- // Do nothing on non-WebKit-based browsers.
- return;
- }
+ return chain;
+}
+function setupWebKitWebXRTestAPI() {
// WebKit setup. The internals object is used by the WebKit test runner
// to provide JS access to internal APIs. In this case it's used to
// ensure that XRTest is only exposed to wpt tests.
navigator.xr.test = internals.xrTest;
return Promise.resolve();
-});
+}
diff --git a/tests/wpt/webgl/meta/conformance2/rendering/draw-buffers.html.ini b/tests/wpt/webgl/meta/conformance2/rendering/draw-buffers.html.ini
index 3c69e83fd9bf..a0687b7bb075 100644
--- a/tests/wpt/webgl/meta/conformance2/rendering/draw-buffers.html.ini
+++ b/tests/wpt/webgl/meta/conformance2/rendering/draw-buffers.html.ini
@@ -125,3 +125,9 @@
[WebGL test #41: attachment 4 should be 0,255,0,255\nat (0, 0) expected: 0,255,0,255 was 0,0,0,0]
expected: FAIL
+ [WebGL test #49: attachment 4 should be 0,255,0,255\nat (0, 0) expected: 0,255,0,255 was 255,0,103,0]
+ expected: FAIL
+
+ [WebGL test #41: attachment 4 should be 0,255,0,255\nat (0, 0) expected: 0,255,0,255 was 255,0,103,0]
+ expected: FAIL
+