diff --git a/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini b/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini new file mode 100644 index 00000000000..a9005e45d6e --- /dev/null +++ b/tests/wpt/metadata-layout-2020/FileAPI/url/url-charset.window.js.ini @@ -0,0 +1,8 @@ +[url-charset.window.html] + expected: TIMEOUT + [Blob charset should override any auto-detected charset.] + expected: TIMEOUT + + [Blob charset should override .] + expected: TIMEOUT + 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 76b44d9e9cf..3605e8f3fc9 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: FAIL + expected: TIMEOUT [Fetching a blob URL immediately before revoking it works in an iframe.] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/cookies/name/name.html.ini b/tests/wpt/metadata-layout-2020/cookies/name/name.html.ini new file mode 100644 index 00000000000..5673d525a2d --- /dev/null +++ b/tests/wpt/metadata-layout-2020/cookies/name/name.html.ini @@ -0,0 +1,22 @@ +[name.html] + [Set a nameless cookie (that has an = in its value)] + expected: FAIL + + [Set a nameless cookie ignoring characters after first ;] + expected: FAIL + + [Ignore invalid attributes after nameless cookie] + expected: FAIL + + [Set a nameless cookie] + expected: FAIL + + [Set a nameless cookie ignoring characters after first ; (2)] + expected: FAIL + + [Set a nameless cookie (that has multiple ='s in its value)] + expected: FAIL + + [Return the most recent nameless cookie] + 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 new file mode 100644 index 00000000000..f64b45fea6b --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-002.html.ini @@ -0,0 +1,4 @@ +[hit-test-floats-002.html] + [Hit test float] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini new file mode 100644 index 00000000000..4bfb0c2053a --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/floats/hit-test-floats-004.html.ini @@ -0,0 +1,4 @@ +[hit-test-floats-004.html] + [Miss float below something else] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini index cb2edcb5dcd..6425f4beda1 100644 --- a/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini +++ b/tests/wpt/metadata-layout-2020/css/CSS2/linebox/inline-negative-margin-001.html.ini @@ -5,6 +5,9 @@ [[data-expected-height\] 7] expected: FAIL - [[data-expected-height\] 4] + [[data-expected-height\] 1] + expected: FAIL + + [[data-expected-height\] 2] expected: FAIL diff --git a/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/hit-test-anonymous-block.html.ini b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/hit-test-anonymous-block.html.ini new file mode 100644 index 00000000000..8efb7024ae4 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/CSS2/normal-flow/hit-test-anonymous-block.html.ini @@ -0,0 +1,4 @@ +[hit-test-anonymous-block.html] + [Hit test beside line of text inside anonymous block] + expected: FAIL + diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini deleted file mode 100644 index 4c79907309b..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/CaretPosition-001.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[CaretPosition-001.html] - [Element at (400, 100)] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini deleted file mode 100644 index e181af5397f..00000000000 --- a/tests/wpt/metadata-layout-2020/css/cssom-view/elementsFromPoint-invalid-cases.html.ini +++ /dev/null @@ -1,4 +0,0 @@ -[elementsFromPoint-invalid-cases.html] - [The root element is the last element returned for otherwise empty queries within the viewport] - expected: FAIL - diff --git a/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini b/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini new file mode 100644 index 00000000000..e6e1f29e274 --- /dev/null +++ b/tests/wpt/metadata-layout-2020/css/cssom-view/matchMedia-display-none-iframe.html.ini @@ -0,0 +1,2 @@ +[matchMedia-display-none-iframe.html] + expected: ERROR diff --git a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini index dfcd4b97189..9150db9d352 100644 --- a/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini +++ b/tests/wpt/metadata-layout-2020/fetch/content-type/response.window.js.ini @@ -309,21 +309,24 @@ [Response: combined response Content-Type: text/html;" \\" text/plain ";charset=GBK] expected: NOTRUN - [ + diff --git a/tests/wpt/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html b/tests/wpt/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html new file mode 100644 index 00000000000..e11f21a4575 --- /dev/null +++ b/tests/wpt/web-platform-tests/resource-timing/fetch-cross-origin-redirect.https.html @@ -0,0 +1,65 @@ + + +Test cross-origin fetch redirects have the right values. + + + + diff --git a/tests/wpt/web-platform-tests/resource-timing/font-timestamps.html b/tests/wpt/web-platform-tests/resource-timing/font-timestamps.html new file mode 100644 index 00000000000..56ecb5c4bfd --- /dev/null +++ b/tests/wpt/web-platform-tests/resource-timing/font-timestamps.html @@ -0,0 +1,62 @@ + + +Test cross-origin fetch redirects have the right values. + + + + + diff --git a/tests/wpt/web-platform-tests/resource-timing/iframe-failed-commit.html b/tests/wpt/web-platform-tests/resource-timing/iframe-failed-commit.html index bd51d33c80f..56fe1d594f9 100644 --- a/tests/wpt/web-platform-tests/resource-timing/iframe-failed-commit.html +++ b/tests/wpt/web-platform-tests/resource-timing/iframe-failed-commit.html @@ -29,6 +29,7 @@ const run_test = async (t, url, csp) => { assert_equals(typeof(list), "object", "No iframe entry was fired"); const entries = list.getEntriesByName(url); assert_equals(entries.length, 1); + assert_greater_than(entries[0].duration, 0, "Duration greater than 0"); } const {REMOTE_ORIGIN, ORIGINAL_HOST, HTTPS_PORT} = get_host_info(); diff --git a/tests/wpt/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect.html b/tests/wpt/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect.html index 9342f5b8838..60a7ef1564b 100644 --- a/tests/wpt/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect.html +++ b/tests/wpt/web-platform-tests/resource-timing/resource_timing_cross_origin_redirect.html @@ -27,6 +27,7 @@ test_equals(entry.secureConnectionStart, 0, 'secureConnectionStart should be 0 in cross-origin redirect.'); test_greater_than(entry.fetchStart, 0, 'fetchStart should be greater than 0 in cross-origin redirect.'); test_greater_than(entry.responseEnd, 0, 'responseEnd should be greater than 0 in cross-origin redirect.'); + test_greater_than(entry.responseEnd, entry.fetchStart, 'responseEnd should be greater than fetchStart in cross-origin redirect.'); done(); } diff --git a/tests/wpt/web-platform-tests/resource-timing/status-codes-create-entry.html b/tests/wpt/web-platform-tests/resource-timing/status-codes-create-entry.html index c31505a452d..cc0cd8ccb88 100644 --- a/tests/wpt/web-platform-tests/resource-timing/status-codes-create-entry.html +++ b/tests/wpt/web-platform-tests/resource-timing/status-codes-create-entry.html @@ -18,13 +18,17 @@ async_test(t => { window.addEventListener("load", t.step_func_done(() => { const images = document.getElementsByTagName("img"); for (let img of images) { - assert_greater_than(performance.getEntriesByName(img.src).length, 0, img.src); + const entries = performance.getEntriesByName(img.src); + assert_greater_than(entries.length, 0, img.src); + assert_greater_than(entries[0].duration, 0, img.src); } const scripts = document.getElementsByTagName("script"); let noSrcScriptFound = false; for (let script of scripts) { if (script.src) { - assert_greater_than(performance.getEntriesByName(script.src).length, 0, script.src); + const entries = performance.getEntriesByName(script.src); + assert_greater_than(entries.length, 0, script.src); + assert_greater_than(entries[0].duration, 0, script.src); } else { // Ignore this script, which has no src value. There should only be one such script. assert_false(noSrcScriptFound); diff --git a/tests/wpt/web-platform-tests/web-nfc/nfc-prompt-manual.https.html b/tests/wpt/web-platform-tests/web-nfc/nfc-prompt-manual.https.html new file mode 100644 index 00000000000..a8b0ce636c9 --- /dev/null +++ b/tests/wpt/web-platform-tests/web-nfc/nfc-prompt-manual.https.html @@ -0,0 +1,56 @@ + + +Web NFC: prompt closes when page reloads + + + +

+ This manual test checks that Web NFC prompt closes when page reloads. +

+
    +
  1. Make sure NFC is disabled at system level
  2. +
  3. Click button to open Web NFC prompt
  4. +
  5. Accept first Web NFC prompt if needed
  6. +
  7. Wait 3 seconds when prompted about turning on the NFC adapter on the system level
  8. +
  9. Page reloads, click button if Web NFC prompt closed
  10. +
+ diff --git a/tests/wpt/web-platform-tests/webcodecs/video-decoder.any.js b/tests/wpt/web-platform-tests/webcodecs/video-decoder.any.js index 2dd85ad955b..33ea2dbe375 100644 --- a/tests/wpt/web-platform-tests/webcodecs/video-decoder.any.js +++ b/tests/wpt/web-platform-tests/webcodecs/video-decoder.any.js @@ -4,7 +4,7 @@ // TODO(sandersd): Move metadata into a helper library. // TODO(sandersd): Add H.264 decode test once there is an API to query for // supported codecs. -let h264 = { +const h264 = { async buffer() { return (await fetch('h264.mp4')).arrayBuffer(); }, codec: "avc1.64000c", description: {offset: 7229, size: 46}, @@ -20,7 +20,7 @@ let h264 = { {offset: 6429, size: 281}] }; -let vp9 = { +const vp9 = { async buffer() { return (await fetch('vp9.mp4')).arrayBuffer(); }, // TODO(sandersd): Verify that the file is actually level 1. codec: "vp09.00.10.08", @@ -36,6 +36,88 @@ let vp9 = { {offset: 5193, size: 159}] }; +const badCodecsList = [ + '', // Empty codec + 'bogus', // Non exsitent codec + 'vorbis', // Audio codec + 'vp9', // Ambiguous codec + 'video/webm; codecs="vp9"' // Codec with mime type + ] + +const invalidConfigs = [ + { + comment: 'Emtpy codec', + config: {codec: ''}, + }, + { + comment: 'Unrecognized codec', + config: {codec: 'bogus'}, + }, + { + comment: 'Audio codec', + config: {codec: 'vorbis'}, + }, + { + comment: 'Ambiguous codec', + config: {codec: 'vp9'}, + }, + { + comment: 'Codec with MIME type', + config: {codec: 'video/webm; codecs="vp8"'}, + }, + { + comment: 'Zero coded size', + config: { + codec: h264.codec, + codedWidth: 0, + codedHeight: 0, + }, + }, + { + comment: 'Out of bounds crop size caused by left/top offset', + config: { + codec: h264.codec, + codedWidth: 1920, + codedHeight: 1088, + cropLeft: 10, + cropTop: 10, + // When unspecified, these default to coded dimensions + // cropWidth: 1920, + // cropHeight: 1088 + }, + }, + { + comment: 'Out of bounds crop size', + config: { + codec: h264.codec, + codedWidth: 1920, + codedHeight: 1088, + cropLeft: 10, + cropTop: 10, + cropWidth: 1920, + cropHeight: 1088, + }, + }, + { + comment: 'Way out of bounds crop size', + config: { + codec: h264.codec, + codedWidth: 1920, + codedHeight: 1088, + cropWidth: 4000, + cropHeight: 5000, + }, + }, + { + comment: 'Invalid display size', + config: { + codec: h264.codec, + displayWidth: 0, + displayHeight: 0, + }, + }, +] // invalidConfigs + function view(buffer, {offset, size}) { return new Uint8Array(buffer, offset, size); } @@ -48,6 +130,40 @@ function getFakeChunk() { }); } +invalidConfigs.forEach(entry => { + promise_test(t => { + return promise_rejects_js(t, TypeError, VideoDecoder.isConfigSupported(entry.config)); + }, 'Test that VideoDecoder.isConfigSupported() rejects invalid config:' + entry.comment); +}); + +invalidConfigs.forEach(entry => { + async_test(t => { + let codec = new VideoDecoder(getDefaultCodecInit(t)); + assert_throws_js(TypeError, () => { codec.configure(entry.config); }); + t.done(); + }, 'Test that VideoDecoder.configure() rejects invalid config:' + entry.comment); +}); + +promise_test(t => { + return VideoDecoder.isConfigSupported({codec: vp9.codec}); +}, 'Test VideoDecoder.isConfigSupported() with minimal valid config'); + +promise_test(t => { + // This config specifies a slight crop. H264 1080p content always crops + // because H264 coded dimensions are a multiple of 16 (e.g. 1088). + return VideoDecoder.isConfigSupported({ + codec: h264.codec, + codedWidth: 1920, + codedHeight: 1088, + cropLeft: 0, + cropTop: 0, + cropWidth: 1920, + cropHeight: 1080, + displayWidth: 1920, + displayHeight: 1080 + }); +}, 'Test VideoDecoder.isConfigSupported() with valid expanded config'); + promise_test(t => { // VideoDecoderInit lacks required fields. assert_throws_js(TypeError, () => { new VideoDecoder({}); }); @@ -65,18 +181,12 @@ promise_test(t => { promise_test(t => { let decoder = new VideoDecoder(getDefaultCodecInit(t)); - let badCodecsList = [ - '', // Empty codec - 'bogus', // Non exsitent codec - 'vorbis', // Audio codec - 'vp9', // Ambiguous codec - 'video/webm; codecs="vp9"' // Codec with mime type - ] - + // TODO(chcunningham): Remove badCodecsList testing. It's now covered more + // extensively by other tests. testConfigurations(decoder, { codec: vp9.codec }, badCodecsList); return endAfterEventLoopTurn(); -}, 'Test VideoDecoder.configure()'); +}, 'Test VideoDecoder.configure() with various codec strings'); promise_test(async t => { let buffer = await vp9.buffer(); diff --git a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html index 4f3a9ce85fa..60f6d0c1335 100644 --- a/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html +++ b/tests/wpt/web-platform-tests/webrtc/RTCRtpTransceiver-stop.html @@ -21,6 +21,18 @@ promise_test(async (t)=> { assert_true(offer.sdp.includes("m=video"), "offer should contain a video m-section"); }, "A transceiver added and stopped before the initial offer generation should not trigger an offer m-section generation"); +promise_test(async (t)=> { + const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); + + pc1.addTransceiver("audio", { direction: "sendonly" }); + pc1.addTransceiver("video"); + assert_equals(null, pc1.getTransceivers()[1].receiver.transport); + + pc1.getTransceivers()[1].stop(); + assert_equals(pc1.getTransceivers()[1].receiver.transport, null); +}, "A transceiver added and stopped should not crash when getting receiver's transport"); + promise_test(async (t)=> { const pc1 = new RTCPeerConnection(); const pc2 = new RTCPeerConnection();