diff options
15 files changed, 280 insertions, 35 deletions
diff --git a/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini b/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini index 3a3d15b8406..6a3af4e2ece 100644 --- a/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini +++ b/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini @@ -37,6 +37,3 @@ [Revoke blob URL after creating Request, will fetch] expected: FAIL - [Revoke blob URL after calling fetch, fetch should succeed] - expected: FAIL - diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 6ea00a66e58..d14c956727f 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -302677,6 +302677,11 @@ {} ] ], + "idle-detection/mock.js": [ + [ + {} + ] + ], "imagebitmap-renderingcontext/META.yml": [ [ {} @@ -352163,6 +352168,12 @@ {} ] ], + "css/css-flexbox/intrinsic-width-overflow-auto.tentative.html": [ + [ + "css/css-flexbox/intrinsic-width-overflow-auto.tentative.html", + {} + ] + ], "css/css-flexbox/order_value.html": [ [ "css/css-flexbox/order_value.html", @@ -396238,6 +396249,12 @@ } ] ], + "idle-detection/interceptor.https.html": [ + [ + "idle-detection/interceptor.https.html", + {} + ] + ], "imagebitmap-renderingcontext/bitmaprenderer-as-imagesource.html": [ [ "imagebitmap-renderingcontext/bitmaprenderer-as-imagesource.html", @@ -578260,6 +578277,10 @@ "0220d79d901cca14324ea331d0ddfd9c086a08ee", "manual" ], + "css/css-flexbox/intrinsic-width-overflow-auto.tentative.html": [ + "8310e66cc4a2ef680d15f5c3ea56feb6edf4252e", + "testharness" + ], "css/css-flexbox/item-with-table-with-infinite-max-intrinsic-width.html": [ "f475db5bcffd1449be231da943cd1511b15e20b1", "reftest" @@ -665480,6 +665501,14 @@ "4bda5c1a85b71e8fcb1c050710279bfec2919b68", "testharness" ], + "idle-detection/interceptor.https.html": [ + "03595afccdcd224f918f6e8baaf21c2419c24062", + "testharness" + ], + "idle-detection/mock.js": [ + "d88d1ad1c55afaee243e1e9146827b073c380613", + "support" + ], "imagebitmap-renderingcontext/META.yml": [ "f6a06f4e7d7625855e271ec5422629ca5e734560", "support" @@ -666633,7 +666662,7 @@ "support" ], "interfaces/mediasession.idl": [ - "0fc9ff05f9475cd7f48fde6c22765d431b51310c", + "6fd5725dbb2975e724594629f0c2882477455caa", "support" ], "interfaces/mediastream-recording.idl": [ diff --git a/tests/wpt/metadata/css/css-flexbox/intrinsic-width-overflow-auto.tentative.html.ini b/tests/wpt/metadata/css/css-flexbox/intrinsic-width-overflow-auto.tentative.html.ini new file mode 100644 index 00000000000..2a33c10d824 --- /dev/null +++ b/tests/wpt/metadata/css/css-flexbox/intrinsic-width-overflow-auto.tentative.html.ini @@ -0,0 +1,7 @@ +[intrinsic-width-overflow-auto.tentative.html] + [.flexbox 1] + expected: FAIL + + [.flexbox 2] + expected: FAIL + diff --git a/tests/wpt/metadata/css/css-fonts/variations/at-font-face-font-matching.html.ini b/tests/wpt/metadata/css/css-fonts/variations/at-font-face-font-matching.html.ini index db33be8df1b..ac6b008980e 100644 --- a/tests/wpt/metadata/css/css-fonts/variations/at-font-face-font-matching.html.ini +++ b/tests/wpt/metadata/css/css-fonts/variations/at-font-face-font-matching.html.ini @@ -149,9 +149,6 @@ [Matching font-style: 'oblique -21deg' should prefer 'oblique -21deg' over 'oblique -60deg -40deg'] expected: FAIL - [Matching font-style: 'oblique -21deg' should prefer 'oblique -10deg' over 'italic'] - expected: FAIL - [Matching font-style: 'oblique -21deg' should prefer 'italic' over 'oblique 0deg'] expected: FAIL diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini deleted file mode 100644 index 385376c7321..00000000000 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_4.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[traverse_the_history_4.html] - [Multiple history traversals, last would be aborted] - expected: FAIL - diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_3.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini index 51f8272a6de..dc2e45516de 100644 --- a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_3.html.ini +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini @@ -1,4 +1,4 @@ -[traverse_the_history_3.html] +[traverse_the_history_5.html] [Multiple history traversals, last would be aborted] expected: FAIL diff --git a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/non-active-document.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/non-active-document.html.ini deleted file mode 100644 index 8cc42056d34..00000000000 --- a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/non-active-document.html.ini +++ /dev/null @@ -1,10 +0,0 @@ -[non-active-document.html] - [DOMParser] - expected: FAIL - - [createHTMLDocument] - expected: FAIL - - [<template>] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini b/tests/wpt/metadata/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini deleted file mode 100644 index 9e522297c94..00000000000 --- a/tests/wpt/metadata/html/semantics/interactive-elements/the-details-element/toggleEvent.html.ini +++ /dev/null @@ -1,7 +0,0 @@ -[toggleEvent.html] - [Calling open twice on 'details' fires only one toggle event] - expected: FAIL - - [Setting open=true to opened 'details' element should not fire a toggle event at the 'details' element] - expected: FAIL - diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html.ini deleted file mode 100644 index 178680e5d14..00000000000 --- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html.ini +++ /dev/null @@ -1,2 +0,0 @@ -[script-onerror-insertion-point-2.html] - expected: TIMEOUT diff --git a/tests/wpt/metadata/html/syntax/parsing/DOMContentLoaded-defer.html.ini b/tests/wpt/metadata/html/syntax/parsing/DOMContentLoaded-defer.html.ini deleted file mode 100644 index a9677391662..00000000000 --- a/tests/wpt/metadata/html/syntax/parsing/DOMContentLoaded-defer.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[DOMContentLoaded-defer.html] - [The end: DOMContentLoaded and defer scripts] - expected: FAIL - diff --git a/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/document-write/iframe_005.html.ini b/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/document-write/iframe_005.html.ini new file mode 100644 index 00000000000..6cf9d13975c --- /dev/null +++ b/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/document-write/iframe_005.html.ini @@ -0,0 +1,4 @@ +[iframe_005.html] + [document.write external script into iframe write back into parent] + expected: FAIL + diff --git a/tests/wpt/web-platform-tests/css/css-flexbox/intrinsic-width-overflow-auto.tentative.html b/tests/wpt/web-platform-tests/css/css-flexbox/intrinsic-width-overflow-auto.tentative.html new file mode 100644 index 00000000000..8310e66cc4a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-flexbox/intrinsic-width-overflow-auto.tentative.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<link rel="author" title="Google" href="https://www.google.com/" /> +<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#intrinsic-sizes" /> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/1865" /> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/check-layout-th.js"></script> + +<body onload="checkLayout('.flexbox')"> +<div class="flexbox" style="display: flex; width: min-content;" data-expected-width="0"> + <div style="overflow: auto;"> + <div style="width: 100px; height: 100px;"></div> + </div> +</div> + +<div class="flexbox" style="display: flex; width: min-content;" data-expected-width="10"> + <div style="overflow: auto; border: 5px solid;"> + <div style="width: 100px; height: 100px;"></div> + </div> +</div> diff --git a/tests/wpt/web-platform-tests/idle-detection/interceptor.https.html b/tests/wpt/web-platform-tests/idle-detection/interceptor.https.html new file mode 100644 index 00000000000..03595afccdc --- /dev/null +++ b/tests/wpt/web-platform-tests/idle-detection/interceptor.https.html @@ -0,0 +1,133 @@ +<!DOCTYPE html> +<link rel="help" href="https://github.com/inexorabletash/idle-detection"> +<title>Tests the Idle Detection API</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script> +<script src="/gen/mojo/public/mojom/base/string16.mojom.js"></script> +<script src="/gen/mojo/public/mojom/base/time.mojom.js"></script> +<script src="/gen/third_party/blink/public/platform/modules/idle/idle_manager.mojom.js"></script> +<script src="mock.js"></script> +<script> +'use strict'; + +promise_test(async t => { + // Basic test that expects navigator.idle.query() to call internally + // addMonitor, which in turn will return an ACTIVE state. + expect(addMonitor).andReturn((threshold, monitorPtr) => { + return Promise.resolve({ + state: { + user: UserIdleState.ACTIVE, + screen: ScreenIdleState.LOCKED + } + }); + }); + + let status = await navigator.idle.query({threshold: 10}); + + assert_equals(status.state.user, "active"); + assert_equals(status.state.screen, "locked"); +}, 'query()'); + +promise_test(async t => { + // Verifies that an event is thrown when a change of state from IDLE to ACTIVE + // is detected. + expect(addMonitor).andReturn((threshold, monitorPtr) => { + t.step_timeout(() => { + monitorPtr.update({ + user: UserIdleState.IDLE, + screen: ScreenIdleState.UNLOCKED + }); + }, 0); + return Promise.resolve({ + state: { + user: UserIdleState.ACTIVE, + screen: ScreenIdleState.UNLOCKED + } + }); + }); + + let monitor = await navigator.idle.query({threshold: 10}); + + await new EventWatcher(t, monitor, ["change"]).wait_for("change"); + + assert_equals(monitor.state.user, "idle"); + assert_equals(monitor.state.screen, "unlocked"); +}, 'updates once'); + + +promise_test(async t => { + // Simulates the user being active, going idle and then going back active + // again. + expect(addMonitor).andReturn((threshold, monitorPtr) => { + // Updates the client once with the user idle. + t.step_timeout(() => { + monitorPtr.update({ + user: UserIdleState.IDLE, + screen: ScreenIdleState.UNLOCKED + }); + }, 0); + // Updates the client a second time with the user active. + t.step_timeout(() => { + monitorPtr.update({ + user: UserIdleState.ACTIVE, + screen: ScreenIdleState.UNLOCKED + }); + }, 1); + return Promise.resolve({ + state: { + user: UserIdleState.ACTIVE, + screen: ScreenIdleState.UNLOCKED + } + }); + }); + + let monitor = await navigator.idle.query({threshold: 10}); + + let watcher = new EventWatcher(t, monitor, ["change"]); + + // waits for the first event. + await watcher.wait_for("change"); + assert_equals(monitor.state.user, "idle"); + + // waits for the second event. + await watcher.wait_for("change"); + assert_equals(monitor.state.user, "active"); +}, 'updates twice'); + +promise_test(async t => { + // Simulates a locked screen. + expect(addMonitor).andReturn((threshold, monitorPtr) => { + return Promise.resolve({ + state: { + user: UserIdleState.ACTIVE, + screen: ScreenIdleState.LOCKED + } + }); + }); + + let monitor = await navigator.idle.query({threshold: 10}); + + assert_equals(monitor.state.screen, "locked"); +}, 'locked screen'); + +promise_test(async t => { + // Simulates the service becoming unavailable. + expect(addMonitor).andReturn((threshold, monitorPtr) => { + return new Promise((resolve, reject) => { + // leave the renderer deliberately hanging by not resolve()-ing. + }); + }); + + let error = new Promise((resolve, reject) => { + navigator.idle.query({threshold: 10}) + .then((e) => {reject("unexpected response :(")}) + .catch((e) => {resolve(e.message)}); + }); + + // simulates what happens when the service is unavailable. + close(); + + assert_equals(await error, "Idle detection not available"); +}, "service unavailable"); +</script>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/idle-detection/mock.js b/tests/wpt/web-platform-tests/idle-detection/mock.js new file mode 100644 index 00000000000..d88d1ad1c55 --- /dev/null +++ b/tests/wpt/web-platform-tests/idle-detection/mock.js @@ -0,0 +1,83 @@ +/** + * This is a testing framework that enables us to test the user idle detection + * by intercepting the connection between the renderer and the browser and + * exposing a mocking API for tests. + * + * Usage: + * + * 1) Include <script src="mock.js"></script> in your file. + * 2) Set expectations + * expect(addMonitor).andReturn((threshold, monitorPtr, callback) => { + * // mock behavior + * }) + * 3) Call navigator.idle.query() + * + * The mocking API is blink agnostic and is designed such that other engines + * could implement it too. Here are the symbols that are exposed to tests: + * + * - function addMonitor(): the main/only function that can be mocked. + * - function expect(): the main/only function that enables us to mock it. + * - function close(): disconnects the interceptor. + * - enum UserIdleState {IDLE, ACTIVE}: blink agnostic constants. + * - enum ScreenIdleState {LOCKED, UNLOCKED}: blink agnostic constants. + */ + +class FakeIdleMonitor { + addMonitor(threshold, monitorPtr, callback) { + return this.handler.addMonitor(threshold, monitorPtr); + } + setHandler(handler) { + this.handler = handler; + return this; + } + setBinding(binding) { + this.binding = binding; + return this; + } + close() { + this.binding.close(); + } +} + +const UserIdleState = {}; +const ScreenIdleState = {}; + +function addMonitor(threshold, monitorPtr, callback) { + throw new Error("expected to be overriden by tests"); +} + +async function close() { + interceptor.close(); +} + +function expect(call) { + return { + andReturn(callback) { + let handler = {}; + handler[call.name] = callback; + interceptor.setHandler(handler); + } + } +} + +function intercept() { + let result = new FakeIdleMonitor(); + + let binding = new mojo.Binding(blink.mojom.IdleManager, result); + let interceptor = new MojoInterfaceInterceptor(blink.mojom.IdleManager.name); + interceptor.oninterfacerequest = (e) => { + binding.bind(e.handle); + } + + interceptor.start(); + + UserIdleState.ACTIVE = blink.mojom.UserIdleState.kActive; + UserIdleState.IDLE = blink.mojom.UserIdleState.kIdle; + ScreenIdleState.LOCKED = blink.mojom.ScreenIdleState.kLocked; + ScreenIdleState.UNLOCKED = blink.mojom.ScreenIdleState.kUnlocked; + + result.setBinding(binding); + return result; +} + +const interceptor = intercept();
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/interfaces/mediasession.idl b/tests/wpt/web-platform-tests/interfaces/mediasession.idl index 0fc9ff05f94..6fd5725dbb2 100644 --- a/tests/wpt/web-platform-tests/interfaces/mediasession.idl +++ b/tests/wpt/web-platform-tests/interfaces/mediasession.idl @@ -22,6 +22,7 @@ enum MediaSessionAction { "previoustrack", "nexttrack", "skipad", + "stop", }; callback MediaSessionActionHandler = void(); |