diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-01-03 22:44:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-03 22:44:53 -0500 |
commit | c6f6fb697d09513a51cdba4077c9ea78dba8afa7 (patch) | |
tree | fee4d9676fcc823f77146d9fdd0cc76a15abdf0b | |
parent | 7c34a70ca8d2087e5d1b7b29ae128b803cecacf9 (diff) | |
parent | 0bc27d4696fb18717902b5fce96359cef8d8f0d6 (diff) | |
download | servo-c6f6fb697d09513a51cdba4077c9ea78dba8afa7.tar.gz servo-c6f6fb697d09513a51cdba4077c9ea78dba8afa7.zip |
Auto merge of #22609 - servo-wpt-sync:wpt_update_03-01-2019, r=jdm
Sync WPT with upstream (03-01-2019)
Automated downstream sync of changes from upstream as of 03-01-2019.
[no-wpt-sync]
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22609)
<!-- Reviewable:end -->
48 files changed, 1126 insertions, 148 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 3b874fc1748..3a3d15b8406 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 @@ -14,6 +14,9 @@ [Revoke blob URL after creating Request, will fetch] expected: FAIL + [Revoke blob URL after calling fetch, fetch should succeed] + expected: FAIL + [url-with-fetch.any.html] [Untitled] diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index f3c9d9f3bc0..dccbc00d8a2 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -12571,6 +12571,12 @@ {} ] ], + "html/editing/dnd/the-datatransferitem-interface/getAsString-manual.html": [ + [ + "/html/editing/dnd/the-datatransferitem-interface/getAsString-manual.html", + {} + ] + ], "html/editing/dnd/the-dragevent-interface/dragevent-manual.html": [ [ "/html/editing/dnd/the-dragevent-interface/dragevent-manual.html", @@ -13165,6 +13171,12 @@ {} ] ], + "mediacapture-depth/dictionary-manual.https.html": [ + [ + "/mediacapture-depth/dictionary-manual.https.html", + {} + ] + ], "mediacapture-streams/MediaStream-MediaElement-preload-none-manual.https.html": [ [ "/mediacapture-streams/MediaStream-MediaElement-preload-none-manual.https.html", @@ -86525,6 +86537,18 @@ {} ] ], + "css/CSS2/stacking-context/opacity-change-parent-stacking-context.html": [ + [ + "/css/CSS2/stacking-context/opacity-change-parent-stacking-context.html", + [ + [ + "/css/CSS2/stacking-context/opacity-change-parent-stacking-context-ref.html", + "==" + ] + ], + {} + ] + ], "css/CSS2/syntax/at-charset-001.xht": [ [ "/css/CSS2/syntax/at-charset-001.xht", @@ -125637,6 +125661,18 @@ {} ] ], + "css/css-lists/li-with-height-001.html": [ + [ + "/css/css-lists/li-with-height-001.html", + [ + [ + "/css/css-lists/li-with-height-001-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-logical/cascading-001.html": [ [ "/css/css-logical/cascading-001.html", @@ -149121,6 +149157,18 @@ {} ] ], + "css/css-transforms/size-change-under-backface-visibility-hidden.html": [ + [ + "/css/css-transforms/size-change-under-backface-visibility-hidden.html", + [ + [ + "/css/css-transforms/size-change-under-backface-visibility-hidden-ref.html", + "==" + ] + ], + {} + ] + ], "css/css-transforms/skew-test1.html": [ [ "/css/css-transforms/skew-test1.html", @@ -204075,6 +204123,11 @@ {} ] ], + "bluetooth/resources/bluetooth-scanning-helpers.js": [ + [ + {} + ] + ], "bluetooth/resources/health-thermometer-iframe.html": [ [ {} @@ -245495,6 +245548,11 @@ {} ] ], + "css/CSS2/stacking-context/opacity-change-parent-stacking-context-ref.html": [ + [ + {} + ] + ], "css/CSS2/support/100x100-lime.png": [ [ {} @@ -265335,6 +265393,11 @@ {} ] ], + "css/css-lists/li-with-height-001-ref.html": [ + [ + {} + ] + ], "css/css-logical/META.yml": [ [ {} @@ -272395,6 +272458,11 @@ {} ] ], + "css/css-transforms/size-change-under-backface-visibility-hidden-ref.html": [ + [ + {} + ] + ], "css/css-transforms/skewX/reference/svg-skewx-ref.html": [ [ {} @@ -288255,6 +288323,11 @@ {} ] ], + "fonts/Ahem.ttf.headers": [ + [ + {} + ] + ], "fonts/CSSTest/LICENSE": [ [ {} @@ -298110,6 +298183,11 @@ {} ] ], + "html/semantics/scripting-1/the-script-element/module/dynamic-import/resources/empty-iframe.html": [ + [ + {} + ] + ], "html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/Function.js": [ [ {} @@ -301640,6 +301718,11 @@ {} ] ], + "mediacapture-depth/dictionary-helper.js": [ + [ + {} + ] + ], "mediacapture-fromelement/META.yml": [ [ {} @@ -377270,6 +377353,12 @@ {} ] ], + "html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-other-document.html": [ + [ + "/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-other-document.html", + {} + ] + ], "html/semantics/scripting-1/the-script-element/module/error-and-slow-dependency.html": [ [ "/html/semantics/scripting-1/the-script-element/module/error-and-slow-dependency.html", @@ -396524,6 +396613,12 @@ {} ] ], + "portals/portals-host-null.html": [ + [ + "/portals/portals-host-null.html", + {} + ] + ], "portals/portals-no-referrer.html": [ [ "/portals/portals-no-referrer.html", @@ -407224,6 +407319,12 @@ {} ] ], + "resource-timing/no-entries-for-cross-origin-css-fetched.sub.html": [ + [ + "/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html", + {} + ] + ], "resource-timing/resource-timing-tojson.html": [ [ "/resource-timing/resource-timing-tojson.html", @@ -421028,9 +421129,9 @@ {} ] ], - "webxr/xrSession_requestFrameOfReference.https.html": [ + "webxr/xrSession_requestReferenceSpace.https.html": [ [ - "/webxr/xrSession_requestFrameOfReference.https.html", + "/webxr/xrSession_requestReferenceSpace.https.html", {} ] ], @@ -455504,7 +455605,11 @@ "testharness" ], "bluetooth/resources/bluetooth-helpers.js": [ - "c4e26077c34283cc6d442cc8bc57f799eadd5a99", + "64a20c2f994164abd16d77143b5e39da89927ed4", + "support" + ], + "bluetooth/resources/bluetooth-scanning-helpers.js": [ + "9b173e6367ce2173336299e4ea005668ca53a03f", "support" ], "bluetooth/resources/health-thermometer-iframe.html": [ @@ -521775,6 +521880,14 @@ "1946e4f25e483b384e55e75cae4a1cd2da2c4cfa", "reftest" ], + "css/CSS2/stacking-context/opacity-change-parent-stacking-context-ref.html": [ + "0e38f92ae4743552c86ac4a65cd8b054ea03a880", + "support" + ], + "css/CSS2/stacking-context/opacity-change-parent-stacking-context.html": [ + "94587c5f6e21b92ab7ab1d5ca3b447eb2bdab15b", + "reftest" + ], "css/CSS2/support/100x100-lime.png": [ "1b947700808585e8c224cee096247eb5d30a1ded", "support" @@ -561999,6 +562112,14 @@ "ff1bcdcfb4690df571dc2d5c93df71b55ffad5e6", "testharness" ], + "css/css-lists/li-with-height-001-ref.html": [ + "486009d5604ab7a2cb66df735efff3c11c00b685", + "support" + ], + "css/css-lists/li-with-height-001.html": [ + "ad2ac65e179714dd5fb85de6b67a6f097823a507", + "reftest" + ], "css/css-lists/list-style-type-armenian-002.xht": [ "02e06b707f709870b30e810e4b1a4ec330ada296", "visual" @@ -576588,7 +576709,7 @@ "support" ], "css/css-transforms/animation/list-interpolation.html": [ - "90cdebbb6cdb643e4c55cb7c0dcd5340fad9a9bd", + "af221e5feaee92734f89185a413e3cd2dc57bc29", "testharness" ], "css/css-transforms/animation/matrix-interpolation.html": [ @@ -578743,6 +578864,14 @@ "b1e0e8b14b6df8df2d135a0032822b1489b73b1e", "reftest" ], + "css/css-transforms/size-change-under-backface-visibility-hidden-ref.html": [ + "e9362c35745416a4ca19a9ab0bf92dd69afb8634", + "support" + ], + "css/css-transforms/size-change-under-backface-visibility-hidden.html": [ + "1543eeb3da3e0efb58239097fe486f1ca85d7c63", + "reftest" + ], "css/css-transforms/skew-test1.html": [ "1f366673488b1a1a4cc2f95096f57a9ef358a23e", "reftest" @@ -615163,6 +615292,10 @@ "4d4785a4123287a5ca08439a6230514de91df0e7", "support" ], + "fonts/Ahem.ttf.headers": [ + "cb762eff806849df46dc758ef7b98b63f27f54c9", + "support" + ], "fonts/CSSTest/LICENSE": [ "9b3c1a6df54771041e357b1ed65aee572dc97bed", "support" @@ -623995,6 +624128,10 @@ "1730c4bc738897d8bd6f0e74febba949e25a932a", "manual" ], + "html/editing/dnd/the-datatransferitem-interface/getAsString-manual.html": [ + "c328f0031b8e04cb7494e3e97516eb92787eb68c", + "manual" + ], "html/editing/dnd/the-dragevent-interface/dragevent-manual.html": [ "aafe83205fdf3fda301caba3a5313a9a177771b6", "manual" @@ -631711,6 +631848,10 @@ "f3322773a42b11868bd472cb004ea5ca41f224f1", "testharness" ], + "html/semantics/scripting-1/the-script-element/module/dynamic-import/resources/empty-iframe.html": [ + "ad5ab30eda15c3f755c8c00b3b81029432e242d9", + "support" + ], "html/semantics/scripting-1/the-script-element/module/dynamic-import/scripts/Function.js": [ "bc88bf7bd637a06e5f1fc23743470144b1dfb55f", "support" @@ -631779,6 +631920,10 @@ "e0e3ec8a94df8b0a27ae513fc6412da1fb87062c", "testharness" ], + "html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-other-document.html": [ + "a9c0528216166a458e48902c2c722a548432f4dd", + "testharness" + ], "html/semantics/scripting-1/the-script-element/module/error-and-slow-dependency.html": [ "f336276f3fcdbe1777b0c3bcf3140999655011b4", "testharness" @@ -637888,9 +638033,17 @@ "support" ], "mediacapture-depth/META.yml": [ - "434612091df41dcf66859c46c66ed8cdaa6ba316", + "e083c9b8c3ab0b20b24976d8ab94f5d04fb243dd", + "support" + ], + "mediacapture-depth/dictionary-helper.js": [ + "46853525f08768617fa5102821e52f1f788caca4", "support" ], + "mediacapture-depth/dictionary-manual.https.html": [ + "e464f293fb1d74a2820fc58217a77895396457ba", + "manual" + ], "mediacapture-depth/idlharness.html": [ "1afc6e5a05b2b8e0a288e7b680cf2920bdd1c525", "testharness" @@ -649163,6 +649316,10 @@ "29134d490f7bdfb09255e190fe91576629057c78", "support" ], + "portals/portals-host-null.html": [ + "e0f1d63743c54c687d62f86abe278873fa823430", + "testharness" + ], "portals/portals-no-referrer.html": [ "0386272f441a0c2e19452821968a624d3ab16700", "testharness" @@ -659132,7 +659289,7 @@ "support" ], "resource-timing/buffer-full-add-after-full-event.html": [ - "07897b5d28dfb281463dc49dc5481d2a1de187b5", + "73ad841e92fddff1e05395241d69a0079e7a84da", "testharness" ], "resource-timing/buffer-full-add-entries-during-callback-that-drop.html": [ @@ -659187,6 +659344,10 @@ "944ee10c44259ac84281cd802144068583d539db", "support" ], + "resource-timing/no-entries-for-cross-origin-css-fetched.sub.html": [ + "92d94a17ec0df642b0a500dbd9fb5aa06eaacb64", + "testharness" + ], "resource-timing/resource-timing-tojson.html": [ "77094f4b843a43fb30aeca48c505337b4322ca81", "testharness" @@ -659456,7 +659617,7 @@ "support" ], "resource-timing/resources/webperftestharnessextension.js": [ - "230f2ac6769d745a7647b16b13d8c6e96fc982b1", + "901cb1db8284a967e87e93afb9da8752fa7a2a7f", "support" ], "resource-timing/resources/worker_with_images.js": [ @@ -686060,15 +686221,15 @@ "testharness" ], "webxr/xrSession_requestAnimationFrame_data_valid.https.html": [ - "4093d7afdb3ad08533521ffb096a92a461c13747", + "5f825fa3d58314479c08716616558666b6eac211", "testharness" ], "webxr/xrSession_requestAnimationFrame_getViewerPose.https.html": [ - "c6d5c1024fbadfa95af7a70216b2338fc43aef1b", + "17b5307f019dc7ec4696dbceef5eb3d5cd21d361", "testharness" ], - "webxr/xrSession_requestFrameOfReference.https.html": [ - "ea758761e59de144a742019cc386b083639db6c9", + "webxr/xrSession_requestReferenceSpace.https.html": [ + "d97852c917bc8f42f4999e5b0d1c13a7fef364ab", "testharness" ], "workers/META.yml": [ diff --git a/tests/wpt/metadata/css/CSS2/stacking-context/opacity-change-parent-stacking-context.html.ini b/tests/wpt/metadata/css/CSS2/stacking-context/opacity-change-parent-stacking-context.html.ini new file mode 100644 index 00000000000..cd8ee521d3d --- /dev/null +++ b/tests/wpt/metadata/css/CSS2/stacking-context/opacity-change-parent-stacking-context.html.ini @@ -0,0 +1,2 @@ +[opacity-change-parent-stacking-context.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata/css/css-transforms/animation/list-interpolation.html.ini b/tests/wpt/metadata/css/css-transforms/animation/list-interpolation.html.ini index 01395fc56f2..1f995fa68f7 100644 --- a/tests/wpt/metadata/css/css-transforms/animation/list-interpolation.html.ini +++ b/tests/wpt/metadata/css/css-transforms/animation/list-interpolation.html.ini @@ -65,3 +65,18 @@ [none -> something: Animation between "none" and "translate(200px) rotate(720deg)" at progress 0.25] expected: FAIL + [Mismatched lengths (from is shorter), partial match: Animation between "rotate(0deg) scaleX(1)" and "rotate(720deg) translateX(0px) scaleX(2)" at progress 0.25] + expected: FAIL + + [Common prefix on primitive: Animation between "scaleY(-3) translateX(0px)" and "scaleX(-3) scaleY(2)" at progress 0.25] + expected: FAIL + + [Mismatched lengths (to is shorter), partial match on primitive: Animation between "scaleY(-3) translateX(0px) scaleX(2)" and "scaleX(-3) scaleY(2)" at progress 0.25] + expected: FAIL + + [Mismatched lengths (from is shorter), partial match on primitive: Animation between "scaleX(-3) scaleY(2)" and "scaleY(-3) translateX(0px) scaleX(2)" at progress 0.25] + expected: FAIL + + [Mismatched lengths (to is shorter), partial match: Animation between "rotate(720deg) translateX(0px) scaleX(2)" and "rotate(0deg) scaleX(1)" at progress 0.25] + expected: FAIL + diff --git a/tests/wpt/metadata/css/css-transforms/size-change-under-backface-visibility-hidden.html.ini b/tests/wpt/metadata/css/css-transforms/size-change-under-backface-visibility-hidden.html.ini new file mode 100644 index 00000000000..743ae46524d --- /dev/null +++ b/tests/wpt/metadata/css/css-transforms/size-change-under-backface-visibility-hidden.html.ini @@ -0,0 +1,2 @@ +[size-change-under-backface-visibility-hidden.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata/css/css-transitions/properties-value-inherit-002.html.ini b/tests/wpt/metadata/css/css-transitions/properties-value-inherit-002.html.ini index be364bf5d9e..cfd5b57b8c0 100644 --- a/tests/wpt/metadata/css/css-transitions/properties-value-inherit-002.html.ini +++ b/tests/wpt/metadata/css/css-transitions/properties-value-inherit-002.html.ini @@ -509,21 +509,3 @@ [text-indent percentage(%) / values] expected: FAIL - [margin-right length(in) / values] - expected: FAIL - - [margin-top length(px) / values] - expected: FAIL - - [margin-top length(pt) / values] - expected: FAIL - - [margin-right length(cm) / values] - expected: FAIL - - [padding-bottom length(cm) / values] - expected: FAIL - - [margin-top length(pc) / values] - expected: FAIL - diff --git a/tests/wpt/metadata/css/css-transitions/transitions-animatable-properties-01.html.ini b/tests/wpt/metadata/css/css-transitions/transitions-animatable-properties-01.html.ini index f7a7bb33d42..8850ec200da 100644 --- a/tests/wpt/metadata/css/css-transitions/transitions-animatable-properties-01.html.ini +++ b/tests/wpt/metadata/css/css-transitions/transitions-animatable-properties-01.html.ini @@ -74,6 +74,3 @@ [opacity end] expected: FAIL - [border-left-width end] - expected: FAIL - diff --git a/tests/wpt/metadata/encoding/single-byte-decoder.html.ini b/tests/wpt/metadata/encoding/single-byte-decoder.html.ini index 592fab4453b..5b00f7d51b1 100644 --- a/tests/wpt/metadata/encoding/single-byte-decoder.html.ini +++ b/tests/wpt/metadata/encoding/single-byte-decoder.html.ini @@ -2,7 +2,7 @@ type: testharness [single-byte-decoder.html?document] - expected: CRASH + expected: TIMEOUT [ISO-8859-4: iso_8859-4:1988 (document.characterSet and document.inputEncoding)] expected: FAIL @@ -55,7 +55,7 @@ expected: FAIL [windows-1252: iso_8859-1:1987 (XMLHttpRequest)] - expected: TIMEOUT + expected: FAIL [windows-1254: iso_8859-9:1989 (XMLHttpRequest)] expected: TIMEOUT @@ -141,26 +141,8 @@ [windows-1254: cp1254 (XMLHttpRequest)] expected: TIMEOUT - [windows-1252: x-cp1252 (XMLHttpRequest)] - expected: TIMEOUT - - [windows-1252: windows-1252 (XMLHttpRequest)] - expected: TIMEOUT - - [windows-1252: latin1 (XMLHttpRequest)] - expected: TIMEOUT - [windows-1253: cp1253 (XMLHttpRequest)] expected: TIMEOUT - [windows-1252: us-ascii (XMLHttpRequest)] - expected: TIMEOUT - - [windows-1252: iso8859-1 (XMLHttpRequest)] - expected: TIMEOUT - - [windows-1252: l1 (XMLHttpRequest)] - expected: TIMEOUT - [single-byte-decoder.html?TextDecoder] diff --git a/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini new file mode 100644 index 00000000000..dc2e45516de --- /dev/null +++ b/tests/wpt/metadata/html/browsers/history/the-history-interface/traverse_the_history_5.html.ini @@ -0,0 +1,4 @@ +[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/environment-changes/viewport-change.html.ini b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html.ini index 6b57ca778ee..fc76a4888b0 100644 --- a/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html.ini +++ b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html.ini @@ -5,7 +5,7 @@ expected: TIMEOUT [picture: source (max-width:500px) valid image, img valid image, resize to wide] - expected: TIMEOUT + expected: FAIL [picture: source (max-width:500px) valid image, img broken image, resize to narrow] expected: TIMEOUT @@ -22,3 +22,12 @@ [picture: same URL in source (max-width:500px) and img, resize to narrow] expected: FAIL + [img (srcset 1 cand) valid image, resize to wide] + expected: FAIL + + [picture: same URL in source (max-width:500px) and img, resize to wide] + expected: FAIL + + [picture: source (max-width:500px) valid image, img broken image, resize to wide] + 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 new file mode 100644 index 00000000000..8cc42056d34 --- /dev/null +++ b/tests/wpt/metadata/html/semantics/embedded-content/the-img-element/non-active-document.html.ini @@ -0,0 +1,10 @@ +[non-active-document.html] + [DOMParser] + expected: FAIL + + [createHTMLDocument] + expected: FAIL + + [<template>] + 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 new file mode 100644 index 00000000000..178680e5d14 --- /dev/null +++ b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/script-onerror-insertion-point-2.html.ini @@ -0,0 +1,2 @@ +[script-onerror-insertion-point-2.html] + expected: TIMEOUT diff --git a/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js.ini b/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js.ini new file mode 100644 index 00000000000..c6d49957c4a --- /dev/null +++ b/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/aborted-parser.window.js.ini @@ -0,0 +1,4 @@ +[aborted-parser.window.html] + [document.open() after parser is aborted] + expected: FAIL + diff --git a/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-exception-vs-return-xml.window.js.ini b/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-exception-vs-return-xml.window.js.ini index 25f0d603b3d..2314441517b 100644 --- a/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-exception-vs-return-xml.window.js.ini +++ b/tests/wpt/metadata/html/webappapis/dynamic-markup-insertion/opening-the-input-stream/bailout-exception-vs-return-xml.window.js.ini @@ -9,3 +9,6 @@ [document.open should throw an InvalidStateError with XML document even when the ignore-opens-during-unload counter is greater than 0 (during pagehide event)] expected: FAIL + [document.open should throw an InvalidStateError with XML document even when there is an active parser executing script] + expected: FAIL + diff --git a/tests/wpt/metadata/performance-timeline/webtiming-resolution.any.js.ini b/tests/wpt/metadata/performance-timeline/webtiming-resolution.any.js.ini index 7725b118e9d..99a24216c88 100644 --- a/tests/wpt/metadata/performance-timeline/webtiming-resolution.any.js.ini +++ b/tests/wpt/metadata/performance-timeline/webtiming-resolution.any.js.ini @@ -12,6 +12,3 @@ [Verifies the resolution of entry.startTime is at least 5 microseconds.] expected: TIMEOUT - [Verifies the resolution of performance.now() is at least 5 microseconds.] - expected: FAIL - diff --git a/tests/wpt/metadata/resource-timing/buffer-full-add-after-full-event.html.ini b/tests/wpt/metadata/resource-timing/buffer-full-add-after-full-event.html.ini index e6fe241b4ed..8f8c89cb287 100644 --- a/tests/wpt/metadata/resource-timing/buffer-full-add-after-full-event.html.ini +++ b/tests/wpt/metadata/resource-timing/buffer-full-add-after-full-event.html.ini @@ -1,5 +1,5 @@ [buffer-full-add-after-full-event.html] expected: ERROR [Test that entry was added to the buffer after a buffer full event] - expected: FAIL + expected: TIMEOUT diff --git a/tests/wpt/metadata/resource-timing/buffer-full-set-to-current-buffer.html.ini b/tests/wpt/metadata/resource-timing/buffer-full-set-to-current-buffer.html.ini index 22395fd3be3..82671979e5a 100644 --- a/tests/wpt/metadata/resource-timing/buffer-full-set-to-current-buffer.html.ini +++ b/tests/wpt/metadata/resource-timing/buffer-full-set-to-current-buffer.html.ini @@ -1,5 +1,5 @@ [buffer-full-set-to-current-buffer.html] expected: ERROR [Test that entries added and event firing happened in the right sequence] - expected: TIMEOUT + expected: FAIL diff --git a/tests/wpt/metadata/resource-timing/resource_dynamic_insertion.html.ini b/tests/wpt/metadata/resource-timing/resource_dynamic_insertion.html.ini index c72ce17c457..909448953a6 100644 --- a/tests/wpt/metadata/resource-timing/resource_dynamic_insertion.html.ini +++ b/tests/wpt/metadata/resource-timing/resource_dynamic_insertion.html.ini @@ -11,3 +11,6 @@ [http://web-platform.test:8000/resource-timing/resources/inject_resource_test.html is expected to have initiatorType iframe] expected: FAIL + [Testing resource entries] + expected: FAIL + diff --git a/tests/wpt/metadata/resource-timing/resource_initiator_types.html.ini b/tests/wpt/metadata/resource-timing/resource_initiator_types.html.ini index 37136277fe2..7429e30d764 100644 --- a/tests/wpt/metadata/resource-timing/resource_initiator_types.html.ini +++ b/tests/wpt/metadata/resource-timing/resource_initiator_types.html.ini @@ -5,3 +5,6 @@ [http://web-platform.test:8000/resource-timing/resources/green_frame.htm is not expected to be in the Resource Timing buffer] expected: FAIL + [Testing resource entries] + expected: FAIL + diff --git a/tests/wpt/metadata/resource-timing/resource_memory_cached.sub.html.ini b/tests/wpt/metadata/resource-timing/resource_memory_cached.sub.html.ini index 7e8a2a7e473..ac0142e016b 100644 --- a/tests/wpt/metadata/resource-timing/resource_memory_cached.sub.html.ini +++ b/tests/wpt/metadata/resource-timing/resource_memory_cached.sub.html.ini @@ -18,3 +18,6 @@ [http://web-platform.test:8000/resource-timing/resources/inject_resource_test.html is not expected to be in the Resource Timing buffer] expected: FAIL + [Testing resource entries] + expected: FAIL + diff --git a/tests/wpt/metadata/resource-timing/resource_redirects.html.ini b/tests/wpt/metadata/resource-timing/resource_redirects.html.ini index c97b716ce5c..020f3b5e163 100644 --- a/tests/wpt/metadata/resource-timing/resource_redirects.html.ini +++ b/tests/wpt/metadata/resource-timing/resource_redirects.html.ini @@ -17,3 +17,6 @@ [http://web-platform.test:8000/resource-timing/resources/inject_resource_test.html is not expected to be in the Resource Timing buffer] expected: FAIL + [Testing resource entries] + expected: FAIL + diff --git a/tests/wpt/metadata/resource-timing/resource_reparenting.html.ini b/tests/wpt/metadata/resource-timing/resource_reparenting.html.ini index 999306ca8ff..809b8c67a90 100644 --- a/tests/wpt/metadata/resource-timing/resource_reparenting.html.ini +++ b/tests/wpt/metadata/resource-timing/resource_reparenting.html.ini @@ -5,3 +5,6 @@ [http://web-platform.test:8000/resource-timing/resources/inject_resource_test.html is not expected to be in the Resource Timing buffer] expected: FAIL + [Testing resource entries] + expected: FAIL + diff --git a/tests/wpt/metadata/resource-timing/resource_script_types.html.ini b/tests/wpt/metadata/resource-timing/resource_script_types.html.ini index 984ebdc1d99..d397efd42bb 100644 --- a/tests/wpt/metadata/resource-timing/resource_script_types.html.ini +++ b/tests/wpt/metadata/resource-timing/resource_script_types.html.ini @@ -29,3 +29,6 @@ [http://web-platform.test:8000/resource-timing/resources/inject_resource_test.html is not expected to be in the Resource Timing buffer] expected: FAIL + [Testing resource entries] + expected: FAIL + diff --git a/tests/wpt/mozilla/meta/css/transition_calc_implicit.html.ini b/tests/wpt/mozilla/meta/css/transition_calc_implicit.html.ini new file mode 100644 index 00000000000..dbea4f293ad --- /dev/null +++ b/tests/wpt/mozilla/meta/css/transition_calc_implicit.html.ini @@ -0,0 +1,2 @@ +[transition_calc_implicit.html] + expected: TIMEOUT diff --git a/tests/wpt/web-platform-tests/bluetooth/resources/bluetooth-helpers.js b/tests/wpt/web-platform-tests/bluetooth/resources/bluetooth-helpers.js index c4e26077c34..64a20c2f994 100644 --- a/tests/wpt/web-platform-tests/bluetooth/resources/bluetooth-helpers.js +++ b/tests/wpt/web-platform-tests/bluetooth/resources/bluetooth-helpers.js @@ -261,6 +261,12 @@ function requestDeviceWithTrustedClick() { () => navigator.bluetooth.requestDevice.apply(navigator.bluetooth, args)); } +// Calls requestLEScan() in a context that's 'allowed to show a popup'. +function requestLEScanWithTrustedClick() { + return callWithTrustedClick( + () => navigator.bluetooth.requestLEScan.apply(navigator.bluetooth)); +} + // errorUUID(alias) returns a UUID with the top 32 bits of // '00000000-97e5-4cd7-b9f1-f5a427670c59' replaced with the bits of |alias|. // For example, errorUUID(0xDEADBEEF) returns diff --git a/tests/wpt/web-platform-tests/bluetooth/resources/bluetooth-scanning-helpers.js b/tests/wpt/web-platform-tests/bluetooth/resources/bluetooth-scanning-helpers.js new file mode 100644 index 00000000000..9b173e6367c --- /dev/null +++ b/tests/wpt/web-platform-tests/bluetooth/resources/bluetooth-scanning-helpers.js @@ -0,0 +1,42 @@ +'use strict'; + +const company_id = '224'; +const data = new TextEncoder().encode('foo'); +const manufacturerDataMap = {[company_id]: data}; +const health_uuid = health_thermometer.uuid; +const serviceDataMap = {[health_uuid]: data}; +const scanRecord = { + name: 'Health Thermometer', + uuids: ['generic_access', health_uuid], + txPower: 20, + appearance: 100, + manufacturerData: manufacturerDataMap, + serviceData: serviceDataMap, +}; +const scanResult = { + deviceAddress: '09:09:09:09:09:09', + rssi: 100, + scanRecord: scanRecord, +}; + +function verifyBluetoothAdvertisingEvent(e) { + assert_equals(e.constructor.name, 'BluetoothAdvertisingEvent') + assert_equals(e.device.name, scanRecord.name) + assert_equals(e.name, scanRecord.name) + assert_array_equals(e.uuids, + ["00001800-0000-1000-8000-00805f9b34fb", + "00001809-0000-1000-8000-00805f9b34fb"]) + assert_equals(e.txPower, 20) + assert_equals(e.rssi, 100) + + assert_equals(e.manufacturerData.constructor.name, + 'BluetoothManufacturerDataMap') + assert_equals(data[0], e.manufacturerData.get(224).getUint8(0)) + assert_equals(data[1], e.manufacturerData.get(224).getUint8(1)) + assert_equals(data[2], e.manufacturerData.get(224).getUint8(2)) + + assert_equals(e.serviceData.constructor.name, 'BluetoothServiceDataMap') + assert_equals(data[0], e.serviceData.get(health_uuid).getUint8(0)) + assert_equals(data[1], e.serviceData.get(health_uuid).getUint8(1)) + assert_equals(data[2], e.serviceData.get(health_uuid).getUint8(2)) +}
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/css/CSS2/stacking-context/opacity-change-parent-stacking-context-ref.html b/tests/wpt/web-platform-tests/css/CSS2/stacking-context/opacity-change-parent-stacking-context-ref.html new file mode 100644 index 00000000000..0e38f92ae47 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/CSS2/stacking-context/opacity-change-parent-stacking-context-ref.html @@ -0,0 +1,8 @@ +<!doctype HTML> +<title>CSS Test Reference</title> +<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org" /> +<div style="width: 100px; height: 100px; background: lightblue; will-change: transform; position: absolute"> + <div id=target style="backface-visibility: hidden"> + <div style="width: 50px; height: 50px; background: lightgray; top: 75px; position: relative"> + </div> +</div> diff --git a/tests/wpt/web-platform-tests/css/CSS2/stacking-context/opacity-change-parent-stacking-context.html b/tests/wpt/web-platform-tests/css/CSS2/stacking-context/opacity-change-parent-stacking-context.html new file mode 100644 index 00000000000..94587c5f6e2 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/CSS2/stacking-context/opacity-change-parent-stacking-context.html @@ -0,0 +1,21 @@ +<!doctype HTML> +<html class="reftest-wait"> + <title>CSS Test: Test for re-paint after stacking context removal due to opacity</title> + <link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org" /> + <link rel="help" href="https://www.w3.org/TR/CSS2/zindex.html"> + <link rel="match" href="opacity-change-parent-stacking-context-ref.html"> + <script src="/common/reftest-wait.js"></script> + <div style="width: 100px; height: 100px; background: lightblue; will-change: transform; position: absolute"> + <div id=target style="opacity: 0; backface-visibility: hidden"> + <div style="width: 50px; height: 50px; background: lightgray; top: 75px; position: relative"> + </div> + </div> + <script> + onload = function() { + requestAnimationFrame(() => requestAnimationFrame(() => { + target.style.opacity = 1; + takeScreenshot(); + })); + } + </script> +</html diff --git a/tests/wpt/web-platform-tests/css/css-lists/li-with-height-001-ref.html b/tests/wpt/web-platform-tests/css/css-lists/li-with-height-001-ref.html new file mode 100644 index 00000000000..486009d5604 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-lists/li-with-height-001-ref.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Lists: list with height</title> + +<p>The test passes if "second" is in the following line of "first".</p> +<ul> + <li id="li_target" style="height:200px; border:1px solid black; width:200px"> + first<div id="div_target" style="overflow:hidden;">second</div> + </li> +</ul> + diff --git a/tests/wpt/web-platform-tests/css/css-lists/li-with-height-001.html b/tests/wpt/web-platform-tests/css/css-lists/li-with-height-001.html new file mode 100644 index 00000000000..ad2ac65e179 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-lists/li-with-height-001.html @@ -0,0 +1,23 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Lists: list with height</title> +<link rel=help href="https://www.w3.org/TR/CSS22/generate.html#lists"> +<link rel=match href="li-with-height-001-ref.html"> +<meta name="assert" content="This is to check the behavior of adding an element at the begining of li" /> + +<p>The test passes if "second" is in the following line of "first".</p> + +<ul> + <li id="li_target" style="height:200px; border:1px solid black; width:200px"> + <div id="div_target" style="overflow:hidden;">second</div> + </li> +</ul> + +<script> + document.body.clientHeight; + + var text_node = document.createTextNode("first"); + var li_target = document.getElementById("li_target"); + var div_target = document.getElementById("div_target"); + li_target.insertBefore(text_node,div_target); +</script> diff --git a/tests/wpt/web-platform-tests/css/css-transforms/animation/list-interpolation.html b/tests/wpt/web-platform-tests/css/css-transforms/animation/list-interpolation.html index 90cdebbb6cd..af221e5feae 100644 --- a/tests/wpt/web-platform-tests/css/css-transforms/animation/list-interpolation.html +++ b/tests/wpt/web-platform-tests/css/css-transforms/animation/list-interpolation.html @@ -135,6 +135,56 @@ test_interpolation( [{ at: 0.25, expect: 'matrix(2, 0, 0, 2, 100, 0)' }], 'Complete mismatch including length' ); + +test_interpolation( + { + property: 'transform', + from: 'rotate(0deg) scaleX(1)', + to: 'rotate(720deg) translateX(0px) scaleX(2)' + }, + [{at: 0.25, expect: 'rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)'}], + 'Mismatched lengths (from is shorter), partial match' +); + +test_interpolation( + { + property: 'transform', + from: 'rotate(720deg) translateX(0px) scaleX(2)', + to: 'rotate(0deg) scaleX(1)' + }, + [{at: 0.25, expect: 'rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)'}], + 'Mismatched lengths (to is shorter), partial match' +); + +test_interpolation( + { + property: 'transform', + from: 'scaleX(-3) scaleY(2)', + to: 'scaleY(-3) translateX(0px) scaleX(2)' + }, + [{at: 0.25, expect: 'scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)'}], + 'Mismatched lengths (from is shorter), partial match on primitive' +); + +test_interpolation( + { + property: 'transform', + from: 'scaleY(-3) translateX(0px) scaleX(2)', + to: 'scaleX(-3) scaleY(2)' + }, + [{at: 0.25, expect: 'scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)'}], + 'Mismatched lengths (to is shorter), partial match on primitive' +); + +test_interpolation( + { + property: 'transform', + from: 'scaleY(-3) translateX(0px)', + to: 'scaleX(-3) scaleY(2)' + }, + [{at: 0.25, expect: 'scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)'}], + 'Common prefix on primitive' +); </script> </body> </html> diff --git a/tests/wpt/web-platform-tests/css/css-transforms/size-change-under-backface-visibility-hidden-ref.html b/tests/wpt/web-platform-tests/css/css-transforms/size-change-under-backface-visibility-hidden-ref.html new file mode 100644 index 00000000000..e9362c35745 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-transforms/size-change-under-backface-visibility-hidden-ref.html @@ -0,0 +1,9 @@ +<!doctype HTML> +<title>CSS Test</title> +<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org" /> +Passes if it shows a green 200x200 square. +<div style="will-change: transform; width: 300px; height: 0px"> + <div style="width: 1px; height: 1px; backface-visibility: hidden;"> + <div id=target style="width: 200px; height: 200px; position: relative; background: green; left: 10px;"></div> + </div> +</div> diff --git a/tests/wpt/web-platform-tests/css/css-transforms/size-change-under-backface-visibility-hidden.html b/tests/wpt/web-platform-tests/css/css-transforms/size-change-under-backface-visibility-hidden.html new file mode 100644 index 00000000000..1543eeb3da3 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-transforms/size-change-under-backface-visibility-hidden.html @@ -0,0 +1,22 @@ +<!doctype HTML> +<html class="reftest-wait"> + <title>CSS Test: Test for re-paint after resizing an element underneath a backface-visibility hidden element</title> + <link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org" /> + <link rel="help" href="https://drafts.csswg.org/css-transforms-2/#propdef-backface-visibility"> + <link rel="match" href="size-change-under-backface-visibility-hidden-ref.html"> + <script src="/common/reftest-wait.js"></script> + Passes if it shows a green 200x200 square. + <div style="will-change: transform; width: 300px; height: 0px"> + <div style="width: 1px; height: 1px; backface-visibility: hidden;"> + <div id=target style="width: 200px; height: 0px; position: relative; background: green; left: 10px;"></div> + </div> + </div> + <script> + onload = function() { + requestAnimationFrame(() => requestAnimationFrame(() => { + target.style.height = '200px'; + takeScreenshot(); + })); + }; + </script> +</html> diff --git a/tests/wpt/web-platform-tests/fonts/Ahem.ttf.headers b/tests/wpt/web-platform-tests/fonts/Ahem.ttf.headers new file mode 100644 index 00000000000..cb762eff806 --- /dev/null +++ b/tests/wpt/web-platform-tests/fonts/Ahem.ttf.headers @@ -0,0 +1 @@ +Access-Control-Allow-Origin: * diff --git a/tests/wpt/web-platform-tests/html/editing/dnd/the-datatransferitem-interface/getAsString-manual.html b/tests/wpt/web-platform-tests/html/editing/dnd/the-datatransferitem-interface/getAsString-manual.html new file mode 100644 index 00000000000..c328f0031b8 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/editing/dnd/the-datatransferitem-interface/getAsString-manual.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>DataTransferItem Test: getAsString()</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<p><input type="text" value="dragcharacters" style="border:2px blue solid; width:200px; height: 100px;"/></p> +<p><input id="container" type="text" style="border:2px green solid; width:200px; height: 100px;"/></p> + +<p>Select all characters in blue box and drag to green box then drop on the green box</p> + +<script> + +setup({explicit_done : true, explicit_timeout : true}); + +let container = document.getElementById("container"); + +on_event(container, "drop", evt => { + let item = evt.dataTransfer.items[0]; + + test(() => { + let file1 = item.getAsFile(); + assert_equals(file1, null); + }, "Check if DataTransferItem.getAsFile return null if drag data item kind is not File"); + + let data; + item.getAsString(str => { + data = str; + }); + setTimeout(() => { + test(() => { + assert_equals(data, "dragcharacters"); + }, "Check if DataTransferItem.getAsString return the dragged string"); + done(); + }, 0); +}); + +</script> diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/resources/empty-iframe.html b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/resources/empty-iframe.html new file mode 100644 index 00000000000..ad5ab30eda1 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/resources/empty-iframe.html @@ -0,0 +1,9 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + </head> + <body> + <div id="dummy"></div> + </body> +</html> diff --git a/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-other-document.html b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-other-document.html new file mode 100644 index 00000000000..a9c05282161 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-other-document.html @@ -0,0 +1,58 @@ +<!doctype html> +<meta charset=utf-8> +<title>Check import() works when active script is in another document</title> +<link rel="author" title="Jon Coppeard" href="mailto:jcoppeard@mozilla.com"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> + +<iframe id="frame" src="resources/empty-iframe.html"></iframe> + +<script> + +function startTest() { + const otherWindow = document.getElementById("frame").contentWindow; + const otherDiv = otherWindow.document.getElementById("dummy"); + + function createTestPromise() { + return new Promise((resolve, reject) => { + otherWindow.continueTest = resolve; + otherWindow.errorTest = reject; + }); + } + + const evaluators = { + eval: otherWindow.eval, + setTimeout: otherWindow.setTimeout, + "the Function constructor"(x) { + otherWindow.Function(x)(); + }, + "reflected inline event handlers"(x) { + otherDiv.setAttribute("onclick", x); + otherDiv.onclick(); + }, + "inline event handlers triggered by JS"(x) { + otherDiv.setAttribute("onclick", x); + otherDiv.click(); // different from .**on**click() + } + }; + + for (const [label, evaluator] of Object.entries(evaluators)) { + promise_test(t => { + t.add_cleanup(() => { + otherDiv.removeAttribute("onclick"); + delete otherWindow.evaluated_imports_a; + }); + + const promise = createTestPromise(); + + evaluator(`import('../imports-a.js?label=${label}').then(window.continueTest, window.errorTest);`); + + return promise.then(module => { + assert_true(otherWindow.evaluated_imports_a, "The module must have been evaluated"); + assert_equals(module.A.from, "imports-a.js", "The module namespace object must be correct"); + }); + }, label + " should successfully import"); + }; +} +</script> +<body onLoad="startTest()"></body> diff --git a/tests/wpt/web-platform-tests/mediacapture-depth/META.yml b/tests/wpt/web-platform-tests/mediacapture-depth/META.yml index 434612091df..e083c9b8c3a 100644 --- a/tests/wpt/web-platform-tests/mediacapture-depth/META.yml +++ b/tests/wpt/web-platform-tests/mediacapture-depth/META.yml @@ -3,3 +3,4 @@ suggested_reviewers: - anssiko - Honry - robman + - astojilj diff --git a/tests/wpt/web-platform-tests/mediacapture-depth/dictionary-helper.js b/tests/wpt/web-platform-tests/mediacapture-depth/dictionary-helper.js new file mode 100644 index 00000000000..46853525f08 --- /dev/null +++ b/tests/wpt/web-platform-tests/mediacapture-depth/dictionary-helper.js @@ -0,0 +1,141 @@ +"use strict"; + +// Helper assertion functions to validate dictionary fields +// on dictionary objects returned from APIs + +function assert_string(object) { + assert_equals(typeof object, "string", + `Expect ${object} to be string`); +} + +function assert_string_field(object, field) { + const str = object[field]; + assert_equals(typeof str, "string", + `Expect dictionary.${field} to be string`); +} + +function assert_number_field(object, field) { + const num = object[field]; + assert_equals(typeof num, "number", + `Expect dictionary.${field} to be number`); +} + +function assert_boolean_field(object, field, value = "") { + const bool = object[field]; + assert_equals(typeof bool, "boolean", + `Expect dictionary.${field} to be boolean`); + if (object[field] !== "") { + assert_equals(object[field], value, + `Expect default value of dictionary.${field} to be ${value}`); + } +} + +function assert_array_field(object, field) { + assert_true(Array.isArray(object[field]), + `Expect dictionary.${field} to be array`); +} + +function assert_enum_field(object, field, validValues) { + assert_string_field(object, field); + assert_true(validValues.includes(object[field]), + `Expect dictionary.${field} to have one of the valid enum values: ${validValues}`); +} + +function assert_number_range_field(object, field, key) { + const num = object[field][key]; + assert_equals(typeof num, "number", + `Expect dictionary.${field}.${key} to be number`); +} + +function assert_boolean_range_field(object, field, key) { + const bool = object[field][key]; + assert_equals(typeof bool, "boolean", + `Expect dictionary.${field}.${key} to be boolean`); +} + +function assert_number_or_number_range_field(object, field) { + if (typeof object[field] !== "object") { + assert_number_field(object, field); + } else { + if (object[field]["max"] !== undefined) + assert_number_range_field(object, field, "max"); + if (object[field]["min"] !== undefined) + assert_number_range_field(object, field, "min"); + if (object[field]["max"] === undefined && + object[field]["min"] === undefined) + assert_unreached(); + } +} + +function assert_constrain_string_field(object, field) { + // test DOMString type + if (typeof object[field] !== "object") { + assert_string_field(object, field); + // test ConstrainDOMStringParameters type + } else if (typeof object[field]["exact"] !== undefined || typeof object[field]["ideal"] !== undefined) { + if (object[field]["exact"] !== undefined) { + // test DOMString type key value of ConstrainDOMStringParameters dictionary + if (typeof object[field] !== "object") { + assert_string_field(object[field], "exact"); + // test sequence<DOMString> type key value of ConstrainDOMStringParameters dictionary + } else { + assert_array_field(object[field], "exact"); + for(const item of object[field]["exact"]) { + assert_string(item); + } + } + } + if (object[field]["ideal"] !== undefined) { + // test DOMString type key value of ConstrainDOMStringParameters dictionary + if (typeof object[field] !== "object") { + assert_string_field(object[field], "ideal"); + // test sequence<DOMString> type key value of ConstrainDOMStringParameters dictionary + } else { + assert_array_field(object[field], "ideal"); + for(const item of object[field]["ideal"]) { + assert_string(item); + } + } + } + // test sequence<DOMString> type + } else { + assert_array_field(object, field); + for(const item of object[field]) { + assert_string(item); + } + } +} + +function assert_constrain_number_field(object, field) { + if (typeof object[field] !== "object") { + assert_number_field(object, field); + } else { + if (object[field]["max"] !== undefined) + assert_number_range_field(object, field, "max"); + if (object[field]["min"] !== undefined) + assert_number_range_field(object, field, "min"); + if (object[field]["exact"] !== undefined) + assert_number_range_field(object, field, "exact"); + if (object[field]["ideal"] !== undefined) + assert_number_range_field(object, field, "ideal"); + if (object[field]["max"] === undefined && + object[field]["min"] === undefined && + object[field]["exact"] === undefined && + object[field]["ideal"] === undefined) + assert_unreached(); + } +} + +function assert_constrain_boolean_field(object, field) { + if (typeof object[field] !== "object") { + assert_boolean_field(object, field); + } else { + if (object[field]["exact"] !== undefined) + assert_boolean_range_field(object, field, "exact"); + if (object[field]["ideal"] !== undefined) + assert_boolean_range_field(object, field, "ideal"); + if (object[field]["exact"] === undefined && + object[field]["ideal"] === undefined) + assert_unreached(); + } +} diff --git a/tests/wpt/web-platform-tests/mediacapture-depth/dictionary-manual.https.html b/tests/wpt/web-platform-tests/mediacapture-depth/dictionary-manual.https.html new file mode 100644 index 00000000000..e464f293fb1 --- /dev/null +++ b/tests/wpt/web-platform-tests/mediacapture-depth/dictionary-manual.https.html @@ -0,0 +1,277 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Media Capture Depth Dictionary Test</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://w3c.github.io/mediacapture-depth/#extensions"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="dictionary-helper.js"></script> +<meta name="flags" content="interact"> + +<h2>Preconditions</h2> +<ol> + <li> + Use a test device with depth camera(embedded or external). + </li> + <li> + When prompted, accept to share your depth/color(RGB) stream. + </li> +</ol> + +<div id="log"></div> + +<script> + +let advanced_constraints_depth = [{ + videoKind: "depth", + focalLengthX: 0.5, + focalLengthY: 0.5, + principalPointX: 0.1, + principalPointY: 0.1, + deprojectionDistortionCoefficients: true, + projectionDistortionCoefficients: true, + depthNear: 0.5, + depthFar: 1, + depthToVideoTransform: true +}]; + +let advanced_constraints_color = [{ + videoKind: "color", + focalLengthX: 0.5, + focalLengthY: 0.5, + principalPointX: 0.1, + principalPointY: 0.1, + deprojectionDistortionCoefficients: true, + projectionDistortionCoefficients: true +}]; + +/* + partial dictionary MediaTrackCapabilities { + // Apply to both depth stream track and color stream track: + DOMString videoKind; + (double or DoubleRange) focalLengthX; + (double or DoubleRange) focalLengthY; + (double or DoubleRange) principalPointX; + (double or DoubleRange) principalPointY; + boolean deprojectionDistortionCoefficients; + boolean projectionDistortionCoefficients; + // Apply to depth stream track: + (double or DoubleRange) depthNear; + (double or DoubleRange) depthFar; + boolean depthToVideoTransform; + }; + + dictionary DoubleRange { + double max; + double min; + }; +*/ + +function validateMediaTrackCapabilities(capabilities, type) { + assert_string_field(capabilities, 'videoKind'); + assert_number_or_number_range_field(capabilities, 'focalLengthX'); + assert_number_or_number_range_field(capabilities, 'focalLengthY'); + assert_number_or_number_range_field(capabilities, 'principalPointX'); + assert_number_or_number_range_field(capabilities, 'principalPointY'); + assert_boolean_field(capabilities, 'deprojectionDistortionCoefficients'); + assert_boolean_field(capabilities, 'projectionDistortionCoefficients'); + if (type == "depth") { + assert_number_or_number_range_field(capabilities, 'depthNear'); + assert_number_or_number_range_field(capabilities, 'depthFar'); + assert_boolean_field(capabilities, 'depthToVideoTransform'); + } +} + +/* + partial dictionary MediaTrackConstraintSet { + // Apply to both depth stream track and color stream track: + ConstrainDOMString videoKind; + ConstrainDouble focalLengthX; + ConstrainDouble focalLengthY; + ConstrainDouble principalPointX; + ConstrainDouble principalPointY; + ConstrainBoolean deprojectionDistortionCoefficients; + ConstrainBoolean projectionDistortionCoefficients; + // Apply to depth stream track: + ConstrainDouble depthNear; + ConstrainDouble depthFar; + ConstrainBoolean depthToVideoTransform; + }; + + typedef (DOMString or sequence<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString; + + dictionary ConstrainDOMStringParameters { + (DOMString or sequence<DOMString>) exact; + (DOMString or sequence<DOMString>) ideal; + }; + + typedef (double or ConstrainDoubleRange) ConstrainDouble; + + dictionary DoubleRange { + double max; + double min; + }; + + dictionary ConstrainDoubleRange : DoubleRange { + double exact; + double ideal; + }; + + typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean; + + dictionary ConstrainBooleanParameters { + boolean exact; + boolean ideal; + }; +*/ + +function validateMediaTrackConstraintSet(constraints, type) { + assert_constrain_string_field(constraints, 'videoKind'); + assert_constrain_number_field(constraints, 'focalLengthX'); + assert_constrain_number_field(constraints, 'focalLengthY'); + assert_constrain_number_field(constraints, 'principalPointX'); + assert_constrain_number_field(constraints, 'principalPointY'); + assert_constrain_boolean_field(constraints, 'deprojectionDistortionCoefficients'); + assert_constrain_boolean_field(constraints, 'projectionDistortionCoefficients'); + if (type == "depth") { + assert_constrain_number_field(constraints, 'depthNear'); + assert_constrain_number_field(constraints, 'depthFar'); + assert_constrain_boolean_field(constraints, 'depthToVideoTransform'); + } +} + +/* + partial dictionary MediaTrackSettings { + // Apply to both depth stream track and color stream track: + DOMString videoKind; + double focalLengthX; + double focalLengthY; + double principalPointX; + double principalPointY; + DistortionCoefficients deprojectionDistortionCoefficients; + DistortionCoefficients projectionDistortionCoefficients; + // Apply to depth stream track: + double depthNear; + double depthFar; + Transformation depthToVideoTransform; + }; + + dictionary DistortionCoefficients { + double k1; + double k2; + double p1; + double p2; + double k3; + }; + + dictionary Transformation { + Float32Array transformationMatrix; + DOMString videoDeviceId; + }; + + enum VideoKindEnum { + "color", + "depth" + }; +*/ + +function validateDistortionCoefficients(coefficients) { + assert_number_field(coefficients, 'k1'); + assert_number_field(coefficients, 'k2'); + assert_number_field(coefficients, 'p1'); + assert_number_field(coefficients, 'p2'); + assert_number_field(coefficients, 'k3'); +} + +function validateTransformation(depthToVideoTransform) { + assert_array_field(depthToVideoTransform, 'transformationMatrix'); + assert_string_field(depthToVideoTransform, 'videoDeviceId'); +} + +function validateMediaTrackSettings(settings, type) { + assert_string_field(settings, 'videoKind'); + assert_enum_field(settings, 'videoKind', ['color', 'depth']) + assert_number_field(settings, 'focalLengthX'); + assert_number_field(settings, 'focalLengthY'); + assert_number_field(settings, 'principalPointX'); + assert_number_field(settings, 'principalPointY'); + if (settings.deprojectionDistortionCoefficients) { + validateDistortionCoefficients(settings.deprojectionDistortionCoefficients); + } + if (settings.projectionDistortionCoefficients) { + validateDistortionCoefficients(settings.projectionDistortionCoefficients); + } + if (type == "depth") { + assert_number_field(settings, 'depthNear'); + assert_number_field(settings, 'depthFar'); + if (settings.depthToVideoTransform) { + validateTransformation(settings.depthToVideoTransform); + } + } +} + +/* + partial dictionary MediaTrackSupportedConstraints { + // Apply to both depth stream track and color stream track: + boolean videoKind = true; + boolean focalLengthX = false; + boolean focalLengthY = false; + boolean principalPointX = false; + boolean principalPointY = false; + boolean deprojectionDistortionCoefficients = false; + boolean projectionDistortionCoefficients = false; + // Apply to depth stream track: + boolean depthNear = false; + boolean depthFar = false; + boolean depthToVideoTransform = false; + }; +*/ + +function validateMediaTrackSupportedConstraints(supports) { + assert_boolean_field(supports, 'videoKind', true); + assert_boolean_field(supports, 'focalLengthX', false); + assert_boolean_field(supports, 'focalLengthY', false); + assert_boolean_field(supports, 'principalPointX', false); + assert_boolean_field(supports, 'principalPointY', false); + assert_boolean_field(supports, 'deprojectionDistortionCoefficients', false); + assert_boolean_field(supports, 'projectionDistortionCoefficients', false); + assert_boolean_field(supports, 'depthNear', false); + assert_boolean_field(supports, 'depthFar', false); + assert_boolean_field(supports, 'depthToVideoTransform', false); +} + +function runDictionaryTests(type, constraints) { + promise_test(t => { + return navigator.mediaDevices.getUserMedia({video: {advanced: constraints}}) + .then(stream => { + let capabilities = stream.getTracks()[0].getCapabilities(); + validateMediaTrackCapabilities(capabilities, type); + }); + }, `MediaTrackCapabilities dictionary of ${type} include attributes are correct`); + + promise_test(t => { + return navigator.mediaDevices.getUserMedia({video: {advanced: constraints}}) + .then(stream => { + let constraints = stream.getTracks()[0].getConstraints()["advanced"][0]; + validateMediaTrackConstraintSet(constraints); + }); + }, `MediaTrackConstraintSet dictionary of ${type} include attributes are correct`); + + promise_test(t => { + return navigator.mediaDevices.getUserMedia({video: {advanced: constraints}}) + .then(stream => { + let settings = stream.getTracks()[0].getSettings(); + validateMediaTrackSettings(settings, type); + }); + }, `MediaTrackSettings dictionary of ${type} include attributes are correct`); +} + +test(() => { + let supports = navigator.mediaDevices.getSupportedConstraints(); + validateMediaTrackSupportedConstraints(supports); +}, "MediaTrackSupportedConstraints dictionary include attributes are correct"); + +runDictionaryTests("depth", advanced_constraints_depth); +runDictionaryTests("color", advanced_constraints_color); + +</script> diff --git a/tests/wpt/web-platform-tests/portals/portals-host-null.html b/tests/wpt/web-platform-tests/portals/portals-host-null.html new file mode 100644 index 00000000000..e0f1d63743c --- /dev/null +++ b/tests/wpt/web-platform-tests/portals/portals-host-null.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<script> + test(t => { + assert_equals(window.portalHost, null, "window.portalHost should be null"); + }); +</script> +</body> diff --git a/tests/wpt/web-platform-tests/resource-timing/buffer-full-add-after-full-event.html b/tests/wpt/web-platform-tests/resource-timing/buffer-full-add-after-full-event.html index 07897b5d28d..73ad841e92f 100644 --- a/tests/wpt/web-platform-tests/resource-timing/buffer-full-add-after-full-event.html +++ b/tests/wpt/web-platform-tests/resource-timing/buffer-full-add-after-full-event.html @@ -72,6 +72,9 @@ promise_test(async () => { await loadRandomResource(); await waitForEventToFire(); await clearAndAddAnotherEntryToBuffer(); + // Since we have no strict guarantees when an entry will be added to the + // buffer, waiting till next task to try to avoid flakiness. + await waitForNextTask(); await testThatEntryWasAdded(); }, "Test that entry was added to the buffer after a buffer full event"); </script> diff --git a/tests/wpt/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html b/tests/wpt/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html new file mode 100644 index 00000000000..92d94a17ec0 --- /dev/null +++ b/tests/wpt/web-platform-tests/resource-timing/no-entries-for-cross-origin-css-fetched.sub.html @@ -0,0 +1,25 @@ +<!DOCTYPE HTML> +<meta charset=utf-8> +<title>Make sure that resources fetched by cross origin CSS are not in the timeline.</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<!-- The stylesheet is fetched from http://www1.web–platform.test:64941/resource-timing/resources/nested.css --> +<link rel=stylesheet id=cross_origin_style href="//{{domains[www1]}}:{{ports[http][1]}}{{location[path]}}/../resources/nested.css"> +<script> + const t = async_test("Make sure that resources fetched by cross origin CSS are not in the timeline."); + window.addEventListener("load", function() { + // A timeout is needed as entries are not guaranteed to be in the timeline before onload triggers. + t.step_timeout(function() { + const url = (new URL(document.getElementById("cross_origin_style").href)); + const prefix = url.protocol + "//" + url.host; + assert_equals(performance.getEntriesByName(prefix + "/resource-timing/resources/resource_timing_test0.css?id=n1").length, 0, "Import should not be in timeline"); + assert_equals(performance.getEntriesByName(prefix + "/fonts/Ahem.ttf?id=n1").length, 0, "Font should not be in timeline"); + assert_equals(performance.getEntriesByName(prefix + "/resource-timing/resources/blue.png?id=n1").length, 0, "Image should not be in timeline"); + t.done(); + },100); + }); +</script> +<ol>Some content</ol> +</body> + diff --git a/tests/wpt/web-platform-tests/resource-timing/resources/webperftestharnessextension.js b/tests/wpt/web-platform-tests/resource-timing/resources/webperftestharnessextension.js index 230f2ac6769..901cb1db828 100644 --- a/tests/wpt/web-platform-tests/resource-timing/resources/webperftestharnessextension.js +++ b/tests/wpt/web-platform-tests/resource-timing/resources/webperftestharnessextension.js @@ -49,45 +49,48 @@ function test_fail(msg, properties) function test_resource_entries(entries, expected_entries) { - // This is slightly convoluted so that we can sort the output. - var actual_entries = {}; - var origin = window.location.protocol + "//" + window.location.host; - - for (var i = 0; i < entries.length; ++i) { - var entry = entries[i]; - var found = false; - for (var expected_entry in expected_entries) { - if (entry.name == origin + expected_entry) { - found = true; - if (expected_entry in actual_entries) { - test_fail(expected_entry + ' is not expected to have duplicate entries'); + test(function() { + // This is slightly convoluted so that we can sort the output. + var actual_entries = {}; + var origin = window.location.protocol + "//" + window.location.host; + + for (var i = 0; i < entries.length; ++i) { + var entry = entries[i]; + var found = false; + for (var expected_entry in expected_entries) { + if (entry.name == origin + expected_entry) { + found = true; + if (expected_entry in actual_entries) { + assert_unreached(expected_entry + ' is not expected to have duplicate entries'); + } + actual_entries[expected_entry] = entry; + break; } - actual_entries[expected_entry] = entry; - break; + } + if (!found) { + assert_unreached(entries[i].name + ' is not expected to be in the Resource Timing buffer'); } } - if (!found) { - test_fail(entries[i].name + ' is not expected to be in the Resource Timing buffer'); - } - } - sorted_urls = []; - for (var i in actual_entries) { - sorted_urls.push(i); - } - sorted_urls.sort(); - for (var i in sorted_urls) { - var url = sorted_urls[i]; - test_equals(actual_entries[url].initiatorType, - expected_entries[url], - origin + url + ' is expected to have initiatorType ' + expected_entries[url]); - } - for (var j in expected_entries) { - if (!(j in actual_entries)) { - test_fail(origin + j + ' is expected to be in the Resource Timing buffer'); + sorted_urls = []; + for (var i in actual_entries) { + sorted_urls.push(i); } - } + sorted_urls.sort(); + for (var i in sorted_urls) { + var url = sorted_urls[i]; + assert_equals(actual_entries[url].initiatorType, + expected_entries[url], + origin + url + ' is expected to have initiatorType ' + expected_entries[url]); + } + for (var j in expected_entries) { + if (!(j in actual_entries)) { + assert_unreached(origin + j + ' is expected to be in the Resource Timing buffer'); + } + } + }, "Testing resource entries"); } + function performance_entrylist_checker(type) { var entryType = type; diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html index 4093d7afdb3..5f825fa3d58 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_data_valid.https.html @@ -34,8 +34,8 @@ let testFunction = function(session, testDeviceController) { testSession = session; - return session.requestFrameOfReference('eye-level') - .then((frameOfRef) => new Promise((resolve) => { + return session.requestReferenceSpace({ type: 'stationary', subtype: 'eye-level' }) + .then((referenceSpace) => new Promise((resolve) => { function onFrame(time, xrFrame) { assert_true(xrFrame instanceof XRFrame); @@ -43,7 +43,7 @@ assert_not_equals(xrFrame.views, null); assert_equals(xrFrame.views.length, 2); - let viewerPose = xrFrame.getViewerPose(frameOfRef); + let viewerPose = xrFrame.getViewerPose(referenceSpace); assert_not_equals(viewerPose, null); for(let i = 0; i < identityMatrix.length; i++) { diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html index c6d5c1024fb..17b5307f019 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html @@ -23,15 +23,15 @@ const validViewMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 4, 3, 2, 1]; let testFunction = function(session, fakeDeviceController, t) { - return session.requestFrameOfReference("eye-level") - .then((frameOfRef) => new Promise((resolve, reject) => { + return session.requestReferenceSpace({ type: 'stationary', subtype: 'eye-level' }) + .then((referenceSpace) => new Promise((resolve, reject) => { let counter = 0; function onFrame(time, vrFrame) { session.requestAnimationFrame(onFrame); if (counter == 0) { t.step( () => { // Expecting to not get a pose since none has been supplied - assert_equals(vrFrame.getViewerPose(frameOfRef), null); + assert_equals(vrFrame.getViewerPose(referenceSpace), null); fakeDeviceController.setXRPresentationFrameData( validPoseMatrix, [{ @@ -45,11 +45,11 @@ }]); // Check that pose does not update pose within the same frame. - assert_equals(vrFrame.getViewerPose(frameOfRef), null); + assert_equals(vrFrame.getViewerPose(referenceSpace), null); }); } else { t.step( () => { - let pose = vrFrame.getViewerPose(frameOfRef); + let pose = vrFrame.getViewerPose(referenceSpace); assert_not_equals(pose, null); let poseMatrix = pose.poseModelMatrix; diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_requestFrameOfReference.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_requestFrameOfReference.https.html deleted file mode 100644 index ea758761e59..00000000000 --- a/tests/wpt/web-platform-tests/webxr/xrSession_requestFrameOfReference.https.html +++ /dev/null @@ -1,49 +0,0 @@ -<!DOCTYPE html> -<body> - <script src=/resources/testharness.js></script> - <script src=/resources/testharnessreport.js></script> - <script src="resources/webxr_util.js"></script> - <canvas></canvas> - <script> - - let immersiveTestName = - "Immersive XRSession requestFrameOfReference returns expected objects"; - let nonImmersiveTestName = - "Non-immersive XRSession requestFrameOfReference returns expected objects"; - - let fakeDeviceInitParams = { supportsImmersive: true }; - - let immersiveSessionOptions = { immersive: true }; - let nonImmersiveSessionOptions = { outputContext: getOutputContext() }; - - let testFunction = function(session, fakeDeviceController, t) { - return promise_rejects(t, new TypeError(), session.requestFrameOfReference("foo")) - .then(() => Promise.all([ - session.requestFrameOfReference("head-model").then( (frameOfRef) => { - assert_true(frameOfRef instanceof XRCoordinateSystem, - "head-model frameOfRef is not correct type."); - assert_true(frameOfRef instanceof XRFrameOfReference, - "head-model frameOfRef is not correct type."); - }), - session.requestFrameOfReference("eye-level").then( (frameOfRef) => { - assert_true(frameOfRef instanceof XRCoordinateSystem, - "eye-level frameOfRef is not correct type."); - assert_true(frameOfRef instanceof XRFrameOfReference, - "eye-level frameOfRef is not correct type."); - }), - session.requestFrameOfReference("stage").then( (frameOfRef) => { - assert_true(frameOfRef instanceof XRCoordinateSystem, - "stage frameOfRef is not correct type."); - assert_true(frameOfRef instanceof XRFrameOfReference, - "stage frameOfRef is not correct type."); - }) - ])); - }; - - xr_session_promise_test( - immersiveTestName, testFunction, fakeDeviceInitParams, immersiveSessionOptions); - xr_session_promise_test( - nonImmersiveTestName, testFunction, fakeDeviceInitParams, nonImmersiveSessionOptions); - - </script> -</body>
\ No newline at end of file diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html new file mode 100644 index 00000000000..d97852c917b --- /dev/null +++ b/tests/wpt/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html @@ -0,0 +1,75 @@ +<!DOCTYPE html> +<body> + <script src=/resources/testharness.js></script> + <script src=/resources/testharnessreport.js></script> + <script src="resources/webxr_util.js"></script> + <canvas></canvas> + <script> + + let immersiveTestName = + "Immersive XRSession requestReferenceSpace returns expected objects"; + let nonImmersiveTestName = + "Non-immersive XRSession requestReferenceSpace returns expected objects"; + + let fakeDeviceInitParams = { supportsImmersive: true }; + + let immersiveSessionOptions = { immersive: true }; + let nonImmersiveSessionOptions = { outputContext: getOutputContext() }; + + let testFunction = function(session, fakeDeviceController, t) { + return promise_rejects(t, new TypeError(), session.requestReferenceSpace({ type: "foo" })) + .then(() => promise_rejects(t, "NotSupportedError", session.requestReferenceSpace({ type: "stationary" }))) + .then(() => promise_rejects(t, new TypeError(), session.requestReferenceSpace({ type: "stationary", subtype: "bar" }))) + .then(() => Promise.all([ + session.requestReferenceSpace({ type: "stationary", subtype: "position-disabled" }).then( (referenceSpace) => { + t.step(() => { + assert_true(referenceSpace instanceof XRSpace, + "position-disabled stationary reference space is not correct type."); + assert_true(referenceSpace instanceof XRReferenceSpace, + "position-disabled stationary reference space is not correct type."); + assert_true(referenceSpace instanceof XRStationaryReferenceSpace, + "position-disabled stationary reference space is not correct type."); + }); + }), + session.requestReferenceSpace({ type: "stationary", subtype: "eye-level" }).then( (referenceSpace) => { + t.step(() => { + assert_true(referenceSpace instanceof XRSpace, + "eye-level stationary reference space is not correct type."); + assert_true(referenceSpace instanceof XRReferenceSpace, + "eye-level stationary reference space is not correct type."); + assert_true(referenceSpace instanceof XRStationaryReferenceSpace, + "eye-level stationary reference space is not correct type."); + }); + }), + session.requestReferenceSpace({ type: "stationary", subtype: "floor-level" }).then( (referenceSpace) => { + t.step(() => { + assert_true(referenceSpace instanceof XRSpace, + "floor-level stationary reference space is not correct type."); + assert_true(referenceSpace instanceof XRReferenceSpace, + "floor-level stationary reference space is not correct type."); + assert_true(referenceSpace instanceof XRStationaryReferenceSpace, + "floor-level stationary reference space is not correct type."); + }); + }) + ])) + .then(() => { + if (!session.immersive) { + // Bounded reference spaces are not allowed in inline sessions. + return promise_rejects(t, "NotSupportedError", session.requestReferenceSpace({ type: "bounded" })) + } + }) + .then(() => { + if (!session.immersive) { + // Unbounded reference spaces are not allowed in inline sessions. + return promise_rejects(t, "NotSupportedError", session.requestReferenceSpace({ type: "unbounded" })) + } + }) + }; + + xr_session_promise_test( + immersiveTestName, testFunction, fakeDeviceInitParams, immersiveSessionOptions); + xr_session_promise_test( + nonImmersiveTestName, testFunction, fakeDeviceInitParams, nonImmersiveSessionOptions); + + </script> +</body>
\ No newline at end of file |