diff --git a/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini index 76b398963ae..dd4ffcf4345 100644 --- a/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini +++ b/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini @@ -1,5 +1,4 @@ [url-in-tags-revoke.window.html] - expected: TIMEOUT [Fetching a blob URL immediately before revoking it works in an iframe.] expected: FAIL @@ -15,6 +14,3 @@ [Opening a blob URL in a new window by clicking an tag works immediately before revoking the URL.] expected: FAIL - [Fetching a blob URL immediately before revoking it works in \ No newline at end of file + + animation.cancel(); + }, "A running worklet animation should output values at specified local time."); + + promise_test(async t => { + await registerConstantLocalTimeAnimator(500); + const effect = new KeyframeEffect(target, [{ opacity: 0 }], { duration: 1000 }); + const animation = new WorkletAnimation('constant_time', effect); + animation.play(); + + await waitForAnimationFrameWithCondition(_=> { + return animation.playState == "running" + }); + + const prevCurrentTime = animation.currentTime; + animation.play(); + assert_equals(animation.playState, "running"); + assert_equals(animation.currentTime, prevCurrentTime) + + animation.cancel(); + }, "Playing a running animation should be a no-op."); + diff --git a/tests/wpt/web-platform-tests/clipboard-apis/async-interfaces.https.html b/tests/wpt/web-platform-tests/clipboard-apis/async-interfaces.https.html index e0d0977959b..e19c958f975 100644 --- a/tests/wpt/web-platform-tests/clipboard-apis/async-interfaces.https.html +++ b/tests/wpt/web-platform-tests/clipboard-apis/async-interfaces.https.html @@ -1,7 +1,7 @@ Clipboard IDL test - + diff --git a/tests/wpt/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html b/tests/wpt/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html index b71b43efe06..706093af613 100644 --- a/tests/wpt/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html +++ b/tests/wpt/web-platform-tests/clipboard-apis/async-navigator-clipboard-basics.https.html @@ -1,6 +1,7 @@ Async Clipboard input type validation tests + @@ -19,14 +20,22 @@ promise_test(async t => { assert_equals(blobText.type, 'text/plain'); assert_equals(blobImage.type, 'image/png'); - await navigator.clipboard.write( + const clipboardItemInput = new ClipboardItem( {'text/plain' : blobText, 'image/png' : blobImage}); - const output = await navigator.clipboard.read(); - assert_equals(Object.keys(output).length, 2); - assert_equals(output['text/plain'].type, 'text/plain'); - assert_equals(output['image/png'].type, 'image/png'); -}, 'Verify write and read clipboard (multiple blobs)'); + await navigator.clipboard.write([clipboardItemInput]); + const clipboardItems = await navigator.clipboard.read(); + + assert_equals(clipboardItems.length, 1); + const clipboardItem = clipboardItems[0]; + assert_true(clipboardItem instanceof ClipboardItem); + + assert_equals(clipboardItem.types.length, 2); + const blobTextOutput = await clipboardItem.getType('text/plain'); + const blobImageOutput = await clipboardItem.getType('image/png'); + assert_equals(blobTextOutput.type, 'text/plain'); + assert_equals(blobImageOutput.type, 'image/png'); +}, 'Verify write and read clipboard (multiple types)');

Note: This is a manual test because it writes/reads to the shared system diff --git a/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html b/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html index fded721f9bf..b374333ca94 100644 --- a/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html +++ b/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-blobtext-manual.https.html @@ -1,19 +1,25 @@ - Async Clipboard write ([text/plain Blob]) -> read ([text/plain Blob]) tests + Async Clipboard write ([text/plain ClipboardItem]) -> + read ([text/plain ClipboardItem]) tests +

diff --git a/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-text-manual.https.html b/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-text-manual.https.html index 98ff7c27b66..2d78b2f186e 100644 --- a/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-text-manual.https.html +++ b/tests/wpt/web-platform-tests/clipboard-apis/async-write-blobtext-read-text-manual.https.html @@ -1,21 +1,25 @@ -Async Clipboard write ([text/plain Blob]) -> readText tests + + Async Clipboard write ([text/plain ClipboardItem]) -> readText tests + +

diff --git a/tests/wpt/web-platform-tests/clipboard-apis/async-write-image-read-image-manual.https.html b/tests/wpt/web-platform-tests/clipboard-apis/async-write-image-read-image-manual.https.html index 6c326cf8dde..351e74bd745 100644 --- a/tests/wpt/web-platform-tests/clipboard-apis/async-write-image-read-image-manual.https.html +++ b/tests/wpt/web-platform-tests/clipboard-apis/async-write-image-read-image-manual.https.html @@ -1,8 +1,10 @@ - Async Clipboard write [image/png Blob] -> read [image/png Blob] tests + Async Clipboard write [image/png ClipboardItem] -> + read [image/png ClipboardItem] tests + @@ -40,10 +42,15 @@ promise_test(async t => { const blobInput = await loadBlob('resources/greenbox.png'); assert_equals(blobInput.type, 'image/png'); - await navigator.clipboard.write({'image/png' : blobInput}); - const blobsOutput = await navigator.clipboard.read(); - assert_equals(Object.keys(blobsOutput).length, 1); - const blobOutput = blobsOutput['image/png']; + const clipboardItemInput = new ClipboardItem({'image/png' : blobInput}); + await navigator.clipboard.write([clipboardItemInput]); + const clipboardItems = await navigator.clipboard.read(); + + assert_equals(clipboardItems.length, 1); + const clipboardItem = clipboardItems[0]; + assert_true(clipboardItem instanceof ClipboardItem); + assert_equals(clipboardItem.types.length, 1); + const blobOutput = await clipboardItem.getType('image/png'); assert_equals(blobOutput.type, 'image/png'); document.getElementById('image-on-clipboard').src = @@ -53,7 +60,7 @@ promise_test(async t => { const comparableOutput = await getBitmapString(blobOutput); assert_equals(comparableOutput, comparableInput); -}, 'Verify write and read clipboard ([image/png Blob])'); +}, 'Verify write and read clipboard [image/png Blob]');

Note: This is a manual test because it writes/reads to the shared system diff --git a/tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-blobtext-manual.https.html b/tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-blobtext-manual.https.html index ab85a6fc649..4f9fe25bca5 100644 --- a/tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-blobtext-manual.https.html +++ b/tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-blobtext-manual.https.html @@ -1,15 +1,21 @@ -Async Clipboard writeText -> read ([text/plain Blob]) tests + + Async Clipboard writeText -> read ([text/plain ClipboardItem]) tests + +

diff --git a/tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html b/tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html index 25c7edb43f0..48e5adb51d2 100644 --- a/tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html +++ b/tests/wpt/web-platform-tests/clipboard-apis/async-write-text-read-text-manual.https.html @@ -1,6 +1,7 @@ Async Clipboard writeText -> readText tests + + + diff --git a/tests/wpt/web-platform-tests/common/get-host-info.sub.js b/tests/wpt/web-platform-tests/common/get-host-info.sub.js index 743bec18ec2..595a539f195 100644 --- a/tests/wpt/web-platform-tests/common/get-host-info.sub.js +++ b/tests/wpt/web-platform-tests/common/get-host-info.sub.js @@ -3,9 +3,12 @@ function get_host_info() { var HTTP_PORT = '{{ports[http][0]}}'; var HTTP_PORT2 = '{{ports[http][1]}}'; var HTTPS_PORT = '{{ports[https][0]}}'; + var PROTOCOL = window.location.protocol; + var IS_HTTPS = (PROTOCOL == "https:"); var HTTP_PORT_ELIDED = HTTP_PORT == "80" ? "" : (":" + HTTP_PORT); var HTTP_PORT2_ELIDED = HTTP_PORT2 == "80" ? "" : (":" + HTTP_PORT2); var HTTPS_PORT_ELIDED = HTTPS_PORT == "443" ? "" : (":" + HTTPS_PORT); + var PORT_ELIDED = IS_HTTPS ? HTTPS_PORT_ELIDED : HTTP_PORT_ELIDED; var ORIGINAL_HOST = '{{host}}'; var REMOTE_HOST = (ORIGINAL_HOST === 'localhost') ? '127.0.0.1' : ('www1.' + ORIGINAL_HOST); var OTHER_HOST = '{{domains[www2]}}'; @@ -18,10 +21,12 @@ function get_host_info() { ORIGINAL_HOST: ORIGINAL_HOST, REMOTE_HOST: REMOTE_HOST, + ORIGIN: PROTOCOL + "//" + ORIGINAL_HOST + PORT_ELIDED, HTTP_ORIGIN: 'http://' + ORIGINAL_HOST + HTTP_PORT_ELIDED, HTTPS_ORIGIN: 'https://' + ORIGINAL_HOST + HTTPS_PORT_ELIDED, HTTPS_ORIGIN_WITH_CREDS: 'https://foo:bar@' + ORIGINAL_HOST + HTTPS_PORT_ELIDED, HTTP_ORIGIN_WITH_DIFFERENT_PORT: 'http://' + ORIGINAL_HOST + HTTP_PORT2_ELIDED, + REMOTE_ORIGIN: PROTOCOL + "//" + REMOTE_HOST + PORT_ELIDED, HTTP_REMOTE_ORIGIN: 'http://' + REMOTE_HOST + HTTP_PORT_ELIDED, HTTP_NOTSAMESITE_ORIGIN: 'http://' + NOTSAMESITE_HOST + HTTP_PORT_ELIDED, HTTP_REMOTE_ORIGIN_WITH_DIFFERENT_PORT: 'http://' + REMOTE_HOST + HTTP_PORT2_ELIDED, diff --git a/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-cluster-001.html b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-cluster-001.html new file mode 100644 index 00000000000..7911a1b214c --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-cluster-001.html @@ -0,0 +1,22 @@ + + +CSS Text level 3 Test: overflow-wrap:break-word and grapheme clusters + + + + + + +

Test passes if there are four identical lines of text below. +

षि
षि
+
षिषि
diff --git a/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-cluster-002.html b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-cluster-002.html new file mode 100644 index 00000000000..bd5c9a60d87 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-cluster-002.html @@ -0,0 +1,22 @@ + + +CSS Text level 3 Test: overflow-wrap:anywhere and grapheme clusters + + + + + + +

Test passes if there are four identical lines of text below. +

षि
षि
+
षिषि
diff --git a/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-normal-keep-all-001.html b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-normal-keep-all-001.html new file mode 100644 index 00000000000..8047aba133a --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-normal-keep-all-001.html @@ -0,0 +1,18 @@ + + +CSS Text level 3 Test: word-break-keep-all and overflow-wrap:normal + + + + + + + +

Test passes if there is a column of 文 characters on top of eachother below. +

文文文文文文文文
diff --git a/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/reference/overflow-wrap-cluster-001-ref.html b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/reference/overflow-wrap-cluster-001-ref.html new file mode 100644 index 00000000000..5a00d7284b2 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/reference/overflow-wrap-cluster-001-ref.html @@ -0,0 +1,17 @@ + + +CSS Text level 3 Test reference + + + +

Test passes if there are four identical lines of text below. +

षि
+
षि
+
षि
+
षि
diff --git a/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/reference/overflow-wrap-normal-keep-all-001-ref.html b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/reference/overflow-wrap-normal-keep-all-001-ref.html new file mode 100644 index 00000000000..f0b41134fa0 --- /dev/null +++ b/tests/wpt/web-platform-tests/css/css-text/overflow-wrap/reference/overflow-wrap-normal-keep-all-001-ref.html @@ -0,0 +1,7 @@ + + +CSS Text level 3 Test reference + + +

Test passes if there is a column of 文 characters on top of eachother below. +








diff --git a/tests/wpt/web-platform-tests/feature-policy/feature-policy-for-sandbox/resources/helper.js b/tests/wpt/web-platform-tests/feature-policy/feature-policy-for-sandbox/resources/helper.js index 09a8aa7846c..9de84165356 100644 --- a/tests/wpt/web-platform-tests/feature-policy/feature-policy-for-sandbox/resources/helper.js +++ b/tests/wpt/web-platform-tests/feature-policy/feature-policy-for-sandbox/resources/helper.js @@ -7,8 +7,8 @@ const ignore_features_for_auxilary_context = ["popups", "scripts"]; // Feature-policies that represent specific sandbox flags. const sandbox_features = [ - "forms", "modals", "orientation-lock", "pointer-lock", "popups", - "presentation", "scripts", "top-navigation"]; + "downloads-without-user-activation", "forms", "modals", "orientation-lock", + "pointer-lock", "popups", "presentation", "scripts", "top-navigation"]; // TODO(ekaramad): Figure out different inheritance requirements for different // policies. diff --git a/tests/wpt/web-platform-tests/interfaces/wake-lock.idl b/tests/wpt/web-platform-tests/interfaces/wake-lock.idl index 4c11b695f49..c0d4bc9c239 100644 --- a/tests/wpt/web-platform-tests/interfaces/wake-lock.idl +++ b/tests/wpt/web-platform-tests/interfaces/wake-lock.idl @@ -11,16 +11,13 @@ enum WakeLockType { "screen", "system" }; [Constructor(WakeLockType type), SecureContext, Exposed=(DedicatedWorker,Window)] interface WakeLock : EventTarget { + [Exposed=Window] static Promise requestPermission(WakeLockType type); readonly attribute WakeLockType type; readonly attribute boolean active; attribute EventHandler onactivechange; - Promise request(optional WakeLockRequestOptions options); + Promise request(); + void abort(); static sequence query(optional WakeLockQueryFilter filter); - [Exposed=Window] static Promise requestPermission(WakeLockType type); -}; - -dictionary WakeLockRequestOptions { - AbortSignal? signal; }; dictionary WakeLockQueryFilter { diff --git a/tests/wpt/web-platform-tests/interfaces/webxr.idl b/tests/wpt/web-platform-tests/interfaces/webxr.idl index edd7e73fd6f..6a455975946 100644 --- a/tests/wpt/web-platform-tests/interfaces/webxr.idl +++ b/tests/wpt/web-platform-tests/interfaces/webxr.idl @@ -10,12 +10,18 @@ partial interface Navigator { [SecureContext, Exposed=Window] interface XR : EventTarget { // Methods Promise supportsSessionMode(XRSessionMode mode); - Promise requestSession(optional XRSessionCreationOptions parameters); + Promise requestSession(XRSessionMode mode); // Events attribute EventHandler ondevicechange; }; +enum XRSessionMode { + "inline", + "immersive-vr", + "immersive-ar" +}; + enum XREnvironmentBlendMode { "opaque", "additive", @@ -50,19 +56,10 @@ enum XREnvironmentBlendMode { attribute EventHandler onselectend; }; -enum XRSessionMode { - "inline", - "immersive-vr", - "immersive-ar" -}; - -dictionary XRSessionCreationOptions { - XRSessionMode mode = "inline"; -}; - dictionary XRRenderStateInit { double depthNear; double depthFar; + double inlineVerticalFieldOfView; XRLayer? baseLayer; XRPresentationContext? outputContext; }; @@ -70,6 +67,7 @@ dictionary XRRenderStateInit { [SecureContext, Exposed=Window] interface XRRenderState { readonly attribute double depthNear; readonly attribute double depthFar; + readonly attribute double? inlineVerticalFieldOfView; readonly attribute XRLayer? baseLayer; readonly attribute XRPresentationContext? outputContext; }; diff --git a/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-paint-lspace-rspace.html b/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-paint-lspace-rspace.html index 66df88264d1..879962c4776 100644 --- a/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-paint-lspace-rspace.html +++ b/tests/wpt/web-platform-tests/mathml/presentation-markup/operators/mo-paint-lspace-rspace.html @@ -13,7 +13,7 @@

The test passes if the arrow has a leading space of 100px, which is as wide as the black block to the left, and a trailing space of 200px, which is as wide as the black block to the right.

- + diff --git a/tests/wpt/web-platform-tests/mathml/relations/html5-tree/required-extensions-1.html b/tests/wpt/web-platform-tests/mathml/relations/html5-tree/required-extensions-1.html deleted file mode 100644 index 3dd7f168ec1..00000000000 --- a/tests/wpt/web-platform-tests/mathml/relations/html5-tree/required-extensions-1.html +++ /dev/null @@ -1,12 +0,0 @@ - - -SVG requiredExtensions - - - - - diff --git a/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-copyTo.tentative.window.js b/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-copyTo.tentative.window.js new file mode 100644 index 00000000000..2019024363a --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-copyTo.tentative.window.js @@ -0,0 +1,72 @@ +// META: script=resources/test-helpers.js +promise_test(async t => cleanupSandboxedFileSystem(), + 'Cleanup to setup test environment'); + +promise_test(async t => { + const old_handle = await createFileWithContents(t, 'old-file', '12345'); + const dir = await old_handle.getParent(); + const new_handle = await old_handle.copyTo(dir, 'new-name'); + t.add_cleanup(() => new_handle.remove()); + + // Verify new file. + assert_true(new_handle.isFile); + assert_false(new_handle.isDirectory); + assert_equals(new_handle.name, 'new-name'); + assert_equals(await getFileContents(new_handle), '12345'); + + // And verify old file is still around as well. + assert_equals(await getFileContents(old_handle), '12345'); + + // Verify directory entries. + assert_array_equals(await getSortedDirectoryEntries(dir), ['new-name', 'old-file']); +}, 'copyTo() into the same parent directory'); + +promise_test(async t => { + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const old_handle = await createFileWithContents(t, 'old-file', '12345'); + const target_dir = await dir.getDirectory('dir-name', { create: true }); + t.add_cleanup(() => target_dir.removeRecursively()); + + const new_handle = await old_handle.copyTo(target_dir); + + // Verify new file. + assert_true(new_handle.isFile); + assert_false(new_handle.isDirectory); + assert_equals(new_handle.name, 'old-file'); + assert_equals(await getFileContents(new_handle), '12345'); + + // And verify old file is still around as well. + assert_equals(await getFileContents(old_handle), '12345'); + + // Verify directory entries. + assert_array_equals(await getSortedDirectoryEntries(dir), ['dir-name/', 'old-file']); + assert_array_equals(await getSortedDirectoryEntries(target_dir), ['old-file']); +}, 'copyTo() to copy a file into a sub-directory'); + + +promise_test(async t => { + const handle = await createFileWithContents(t, 'old-file', '12345'); + const dir = await handle.getParent(); + + await promise_rejects(t, 'InvalidModificationError', handle.copyTo(dir)); + await promise_rejects(t, 'InvalidModificationError', handle.copyTo(dir, handle.name)); + + // Verify file still exists. + assert_equals(await getFileContents(handle), '12345'); + assert_array_equals(await getSortedDirectoryEntries(dir), ['old-file']); +}, 'copyTo() with existing name and parent should fail'); + +promise_test(async t => { + const handle = await createFileWithContents(t, 'old-file', '12345'); + const target_handle = await createFileWithContents(t, 'target', 'abc'); + const dir = await handle.getParent(); + + await handle.copyTo(dir, target_handle.name); + + // Verify state of files. + assert_equals(await getFileContents(handle), '12345'); + assert_equals(await getFileContents(target_handle), '12345'); + assert_array_equals(await getSortedDirectoryEntries(dir), ['old-file', 'target']); +}, 'copyTo() when target file already exists should overwrite target'); + +// TODO(mek): Tests to copy directories. diff --git a/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-moveTo.tentative.window.js b/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-moveTo.tentative.window.js new file mode 100644 index 00000000000..3badce1ca94 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-moveTo.tentative.window.js @@ -0,0 +1,72 @@ +// META: script=resources/test-helpers.js +promise_test(async t => cleanupSandboxedFileSystem(), + 'Cleanup to setup test environment'); + +promise_test(async t => { + const old_handle = await createFileWithContents(t, 'old-file', '12345'); + const dir = await old_handle.getParent(); + const new_handle = await old_handle.moveTo(dir, 'new-name'); + t.add_cleanup(() => new_handle.remove()); + + // Verify new file. + assert_true(new_handle.isFile); + assert_false(new_handle.isDirectory); + assert_equals(new_handle.name, 'new-name'); + assert_equals(await getFileContents(new_handle), '12345'); + + // And verify old file is gone. + await promise_rejects(t, 'NotFoundError', getFileContents(old_handle)); + + // Verify directory entries. + assert_array_equals(await getSortedDirectoryEntries(dir), ['new-name']); +}, 'moveTo() to rename a file'); + +promise_test(async t => { + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const old_handle = await createFileWithContents(t, 'old-file', '12345'); + const target_dir = await dir.getDirectory('dir-name', { create: true }); + t.add_cleanup(() => target_dir.removeRecursively()); + + const new_handle = await old_handle.moveTo(target_dir); + + // Verify new file. + assert_true(new_handle.isFile); + assert_false(new_handle.isDirectory); + assert_equals(new_handle.name, 'old-file'); + assert_equals(await getFileContents(new_handle), '12345'); + + // And verify old file is gone. + await promise_rejects(t, 'NotFoundError', getFileContents(old_handle)); + + // Verify directory entries. + assert_array_equals(await getSortedDirectoryEntries(dir), ['dir-name/']); + assert_array_equals(await getSortedDirectoryEntries(target_dir), ['old-file']); +}, 'moveTo() to move a file into a sub-directory'); + + +promise_test(async t => { + const handle = await createFileWithContents(t, 'old-file', '12345'); + const dir = await handle.getParent(); + + await promise_rejects(t, 'InvalidModificationError', handle.moveTo(dir)); + await promise_rejects(t, 'InvalidModificationError', handle.moveTo(dir, handle.name)); + + // Verify file still exists. + assert_equals(await getFileContents(handle), '12345'); + assert_array_equals(await getSortedDirectoryEntries(dir), ['old-file']); +}, 'moveTo() with existing name and parent should fail'); + +promise_test(async t => { + const handle = await createFileWithContents(t, 'old-file', '12345'); + const target_handle = await createFileWithContents(t, 'target', 'abc'); + const dir = await handle.getParent(); + + await handle.moveTo(dir, target_handle.name); + + // Verify state of files. + await promise_rejects(t, 'NotFoundError', getFileContents(handle)); + assert_equals(await getFileContents(target_handle), '12345'); + assert_array_equals(await getSortedDirectoryEntries(dir), ['target']); +}, 'moveTo() when target file already exists should overwrite target'); + +// TODO(mek): Tests to move directories. \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-remove.tentative.window.js b/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-remove.tentative.window.js new file mode 100644 index 00000000000..33ac9603882 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/FileSystemBaseHandle-remove.tentative.window.js @@ -0,0 +1,41 @@ +// META: script=resources/test-helpers.js +promise_test(async t => cleanupSandboxedFileSystem(), + 'Cleanup to setup test environment'); + +promise_test(async t => { + const handle = await createFileWithContents(t, 'file-to-remove', '12345'); + const dir = await handle.getParent(); + await createFileWithContents(t, 'file-to-keep', 'abc'); + await handle.remove(); + + assert_array_equals(await getSortedDirectoryEntries(dir), ['file-to-keep']); + await promise_rejects(t, 'NotFoundError', getFileContents(handle)); +}, 'remove() to remove a file'); + +promise_test(async t => { + const handle = await createFileWithContents(t, 'file-to-remove', '12345'); + await handle.remove(); + + await promise_rejects(t, 'NotFoundError', handle.remove()); +}, 'remove() on an already removed file should fail'); + +promise_test(async t => { + const root = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const dir = await root.getDirectory('dir-to-remove', { create: true }); + await createFileWithContents(t, 'file-to-keep', 'abc'); + await dir.remove(); + + assert_array_equals(await getSortedDirectoryEntries(root), ['file-to-keep']); + await promise_rejects(t, 'NotFoundError', getSortedDirectoryEntries(dir)); +}, 'remove() to remove an empty directory'); + +promise_test(async t => { + const root = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const dir = await root.getDirectory('dir-to-remove', { create: true }); + t.add_cleanup(() => dir.removeRecursively()); + await createEmptyFile(t, 'file-in-dir', dir); + + await promise_rejects(t, 'InvalidModificationError', dir.remove()); + assert_array_equals(await getSortedDirectoryEntries(root), ['dir-to-remove/']); + assert_array_equals(await getSortedDirectoryEntries(dir), ['file-in-dir']); +}, 'remove() on a non-empty directory should fail'); \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/native-file-system/FileSystemDirectoryHandle-getDirectory.tentative.window.js b/tests/wpt/web-platform-tests/native-file-system/FileSystemDirectoryHandle-getDirectory.tentative.window.js new file mode 100644 index 00000000000..105879dbd1e --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/FileSystemDirectoryHandle-getDirectory.tentative.window.js @@ -0,0 +1,57 @@ +// META: script=resources/test-helpers.js +promise_test(async t => cleanupSandboxedFileSystem(), + 'Cleanup to setup test environment'); + +promise_test(async t => { + const root = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + await promise_rejects(t, 'NotFoundError', root.getDirectory('non-existing-dir')); +}, 'getDirectory(create=false) rejects for non-existing directories'); + +promise_test(async t => { + const root = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const handle = await root.getDirectory('non-existing-dir', { create: true }); + t.add_cleanup(() => handle.removeRecursively()); + + assert_false(handle.isFile); + assert_true(handle.isDirectory); + assert_equals(handle.name, 'non-existing-dir'); + assert_equals(await getDirectoryEntryCount(handle), 0); + assert_array_equals(await getSortedDirectoryEntries(root), ['non-existing-dir/']); +}, 'getDirectory(create=true) creates an empty directory'); + +promise_test(async t => { + const root = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const existing_handle = await root.getDirectory('dir-with-contents', { create: true }); + t.add_cleanup(() => existing_handle.removeRecursively()); + const file_handle = await createEmptyFile(t, 'test-file', existing_handle); + + const handle = await root.getDirectory('dir-with-contents', { create: false }); + + assert_false(handle.isFile); + assert_true(handle.isDirectory); + assert_equals(handle.name, 'dir-with-contents'); + assert_array_equals(await getSortedDirectoryEntries(handle), ['test-file']); +}, 'getDirectory(create=false) returns existing directories'); + +promise_test(async t => { + const root = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const existing_handle = await root.getDirectory('dir-with-contents', { create: true }); + t.add_cleanup(() => existing_handle.removeRecursively()); + const file_handle = await existing_handle.getFile('test-file', { create: true }); + + const handle = await root.getDirectory('dir-with-contents', { create: true }); + + assert_false(handle.isFile); + assert_true(handle.isDirectory); + assert_equals(handle.name, 'dir-with-contents'); + assert_array_equals(await getSortedDirectoryEntries(handle), ['test-file']); +}, 'getDirectory(create=true) returns existing directories without erasing'); + +promise_test(async t => { + const root = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + await createEmptyFile(t, 'file-name'); + + await promise_rejects(t, 'TypeMismatchError', root.getDirectory('file-name')); + await promise_rejects(t, 'TypeMismatchError', root.getDirectory('file-name', { create: false })); + await promise_rejects(t, 'TypeMismatchError', root.getDirectory('file-name', { create: true })); +}, 'getDirectory() when a file already exists with the same name'); diff --git a/tests/wpt/web-platform-tests/native-file-system/FileSystemDirectoryHandle-getFile.tentative.window.js b/tests/wpt/web-platform-tests/native-file-system/FileSystemDirectoryHandle-getFile.tentative.window.js new file mode 100644 index 00000000000..0d9bacd87ee --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/FileSystemDirectoryHandle-getFile.tentative.window.js @@ -0,0 +1,62 @@ +// META: script=resources/test-helpers.js +promise_test(async t => cleanupSandboxedFileSystem(), + 'Cleanup to setup test environment'); + +promise_test(async t => { + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + await promise_rejects(t, 'NotFoundError', dir.getFile('non-existing-file')); +}, 'getFile(create=false) rejects for non-existing files'); + +promise_test(async t => { + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const handle = await dir.getFile('non-existing-file', { create: true }); + t.add_cleanup(() => handle.remove()); + + assert_true(handle.isFile); + assert_false(handle.isDirectory); + assert_equals(handle.name, 'non-existing-file'); + assert_equals(await getFileSize(handle), 0); + assert_equals(await getFileContents(handle), ''); +}, 'getFile(create=true) creates an empty file for non-existing files'); + +promise_test(async t => { + const existing_handle = await createFileWithContents(t, 'existing-file', '1234567890'); + + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const handle = await dir.getFile('existing-file'); + + assert_true(handle.isFile); + assert_false(handle.isDirectory); + assert_equals(handle.name, 'existing-file'); + assert_equals(await getFileSize(handle), 10); + assert_equals(await getFileContents(handle), '1234567890'); +}, 'getFile(create=false) returns existing files'); + +promise_test(async t => { + const existing_handle = await createFileWithContents(t, 'file-with-contents', '1234567890'); + + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const handle = await dir.getFile('file-with-contents', { create: true }); + + assert_true(handle.isFile); + assert_false(handle.isDirectory); + assert_equals(handle.name, 'file-with-contents'); + assert_equals(await getFileSize(handle), 10); + assert_equals(await getFileContents(handle), '1234567890'); +}, 'getFile(create=true) returns existing files without erasing'); + +promise_test(async t => { + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const dir_handle = await dir.getDirectory('dir-name', { create: true }); + t.add_cleanup(() => dir_handle.removeRecursively()); + + await promise_rejects(t, 'TypeMismatchError', dir.getFile('dir-name')); +}, 'getFile(create=false) when a directory already exists with the same name'); + +promise_test(async t => { + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const dir_handle = await dir.getDirectory('dir-name', { create: true }); + t.add_cleanup(() => dir_handle.removeRecursively()); + + await promise_rejects(t, 'TypeMismatchError', dir.getFile('dir-name', { create: true })); +}, 'getFile(create=true) when a directory already exists with the same name'); \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/native-file-system/FileSystemWriter.tentative.window.js b/tests/wpt/web-platform-tests/native-file-system/FileSystemWriter.tentative.window.js new file mode 100644 index 00000000000..cc8444237b6 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/FileSystemWriter.tentative.window.js @@ -0,0 +1,96 @@ +// META: script=resources/test-helpers.js +promise_test(async t => cleanupSandboxedFileSystem(), + 'Cleanup to setup test environment'); + +promise_test(async t => { + const handle = await createEmptyFile(t, 'empty_blob'); + const writer = await handle.createWriter(); + + await writer.write(0, new Blob([])); + + assert_equals(await getFileContents(handle), ''); + assert_equals(await getFileSize(handle), 0); +}, 'write() with an empty blob to an empty file'); + +promise_test(async t => { + const handle = await createEmptyFile(t, 'valid_blob'); + const writer = await handle.createWriter(); + + await writer.write(0, new Blob(['1234567890'])); + + assert_equals(await getFileContents(handle), '1234567890'); + assert_equals(await getFileSize(handle), 10); +}, 'write() a blob to an empty file'); + +promise_test(async t => { + const handle = await createEmptyFile(t, 'blob_with_offset'); + const writer = await handle.createWriter(); + + await writer.write(0, new Blob(['1234567890'])); + await writer.write(4, new Blob(['abc'])); + + assert_equals(await getFileContents(handle), '1234abc890'); + assert_equals(await getFileSize(handle), 10); +}, 'write() called with a blob and a valid offset'); + +promise_test(async t => { + const handle = await createEmptyFile(t, 'bad_offset'); + const writer = await handle.createWriter(); + + await promise_rejects(t, 'InvalidStateError', writer.write(4, new Blob(['abc']))); + + assert_equals(await getFileContents(handle), ''); + assert_equals(await getFileSize(handle), 0); +}, 'write() called with an invalid offset'); + +promise_test(async t => { + const handle = await createEmptyFile(t, 'trunc_shrink'); + const writer = await handle.createWriter(); + + await writer.write(0, new Blob(['1234567890'])); + await writer.truncate(5); + + assert_equals(await getFileContents(handle), '12345'); + assert_equals(await getFileSize(handle), 5); +}, 'truncate() to shrink a file'); + +promise_test(async t => { + const handle = await createEmptyFile(t, 'trunc_grow'); + const writer = await handle.createWriter(); + + await writer.write(0, new Blob(['abc'])); + await writer.truncate(5); + + assert_equals(await getFileContents(handle), 'abc\0\0'); + assert_equals(await getFileSize(handle), 5); +}, 'truncate() to grow a file'); + +promise_test(async t => { + const handle = await createEmptyFile(t, 'write_stream'); + const writer = await handle.createWriter(); + + const stream = new Response('1234567890').body; + await writer.write(0, stream); + + assert_equals(await getFileContents(handle), '1234567890'); + assert_equals(await getFileSize(handle), 10); +}, 'write() called with a ReadableStream'); + +promise_test(async t => { + const handle = await createEmptyFile(t, 'write_stream'); + const handle_writer = await handle.createWriter(); + + const { writable, readable } = new TransformStream(); + const write_result = handle_writer.write(0, readable); + + const stream_writer = writable.getWriter(); + stream_writer.write(new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61, 0x6D, 0x73, 0x21])); + garbageCollect(); + stream_writer.write(new Uint8Array([0x21, 0x21])); + stream_writer.close(); + + await write_result; + + assert_equals(await getFileContents(handle), 'streams!!!'); + assert_equals(await getFileSize(handle), 10); +}, 'Using a WritableStream writer to write'); diff --git a/tests/wpt/web-platform-tests/native-file-system/README.md b/tests/wpt/web-platform-tests/native-file-system/README.md new file mode 100644 index 00000000000..6905a68e790 --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/README.md @@ -0,0 +1,2 @@ +This directory contains (tentative) tests for the +[Native File System](https://wicg.github.io/native-file-system/) specification. diff --git a/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js b/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js new file mode 100644 index 00000000000..dc5f376233b --- /dev/null +++ b/tests/wpt/web-platform-tests/native-file-system/resources/test-helpers.js @@ -0,0 +1,67 @@ +async function cleanupSandboxedFileSystem() { + const dir = await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + for await (let entry of dir.getEntries()) { + if (entry.isDirectory) + await entry.removeRecursively(); + else + await entry.remove(); + } +} + +async function getFileSize(handle) { + const file = await handle.getFile(); + return file.size; +} + +async function getFileContents(handle) { + const file = await handle.getFile(); + return new Response(file).text(); +} + +async function getDirectoryEntryCount(handle) { + let result = 0; + for await (let entry of handle.getEntries()) { + result++; + } + return result; +} + +async function getSortedDirectoryEntries(handle) { + let result = []; + for await (let entry of handle.getEntries()) { + if (entry.isDirectory) + result.push(entry.name + '/'); + else + result.push(entry.name); + } + result.sort(); + return result; +} + +async function createEmptyFile(test, name, parent) { + const dir = parent ? parent : await FileSystemDirectoryHandle.getSystemDirectory({ type: 'sandbox' }); + const handle = await dir.getFile(name, { create: true }); + test.add_cleanup(async () => { + try { + await handle.remove(); + } catch (e) { + // Ignore any errors when removing files, as tests might already remove the file. + } + }); + // Make sure the file is empty. + assert_equals(await getFileSize(handle), 0); + return handle; +} + +async function createFileWithContents(test, name, contents, parent) { + const handle = await createEmptyFile(test, name, parent); + const writer = await handle.createWriter(); + await writer.write(0, new Blob([contents])); + return handle; +} + +function garbageCollect() { + // TODO(https://github.com/web-platform-tests/wpt/issues/7899): Change to + // some sort of cross-browser GC trigger. + if (self.gc) self.gc(); +}; \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/resource-timing/crossorigin-sandwich-TAO.sub.html b/tests/wpt/web-platform-tests/resource-timing/crossorigin-sandwich-TAO.sub.html new file mode 100644 index 00000000000..c3085950bd6 --- /dev/null +++ b/tests/wpt/web-platform-tests/resource-timing/crossorigin-sandwich-TAO.sub.html @@ -0,0 +1,46 @@ + + + + +This test validates resource timing information for a same-origin=>cross-origin=>same-origin redirect chain with Timing-Allow-Origin. + + + + + + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/resource-timing/crossorigin-sandwich-no-TAO.sub.html b/tests/wpt/web-platform-tests/resource-timing/crossorigin-sandwich-no-TAO.sub.html new file mode 100644 index 00000000000..c7e7e5948dc --- /dev/null +++ b/tests/wpt/web-platform-tests/resource-timing/crossorigin-sandwich-no-TAO.sub.html @@ -0,0 +1,45 @@ + + + + +This test validates resource timing information for a same-origin=>cross-origin=>same-origin redirect chain without Timing-Allow-Origin. + + + + + + + + + + + + + + + diff --git a/tests/wpt/web-platform-tests/resource-timing/resources/multi_redirect.py b/tests/wpt/web-platform-tests/resource-timing/resources/multi_redirect.py index d1802a1e02d..39121ddbb45 100644 --- a/tests/wpt/web-platform-tests/resource-timing/resources/multi_redirect.py +++ b/tests/wpt/web-platform-tests/resource-timing/resources/multi_redirect.py @@ -13,27 +13,31 @@ def main(request, response): except ValueError: pass + origin = request.url_parts.scheme + "://" + request.url_parts.hostname + ":" + str(request.url_parts.port) page_origin = request.GET.first("page_origin") cross_origin = request.GET.first("cross_origin") timing_allow = "0" if "timing_allow" in request.GET: timing_allow = request.GET.first("timing_allow") - redirect_url = "/resource-timing/resources/multi_redirect.py?" - redirect_url += "page_origin=" + page_origin - redirect_url += "&cross_origin=" + cross_origin - redirect_url += "&timing_allow=" + timing_allow - redirect_url += "&step=" + redirect_url_path = "/resource-timing/resources/multi_redirect.py?" + redirect_url_path += "page_origin=" + page_origin + redirect_url_path += "&cross_origin=" + cross_origin + redirect_url_path += "&timing_allow=" + timing_allow + redirect_url_path += "&step=" if step == 1: - redirect_url = cross_origin + redirect_url + "2" - if timing_allow != "0": + # On the first request, redirect to a cross origin URL + redirect_url = cross_origin + redirect_url_path + "2" + if timing_allow != "0" and origin != page_origin: response.headers.set("timing-allow-origin", page_origin) elif step == 2: - redirect_url = page_origin + redirect_url + "3" + # On the second request, redirect to a same origin URL + redirect_url = page_origin + redirect_url_path + "3" if timing_allow != "0": response.headers.set("timing-allow-origin", page_origin) else: + # On the third request, redirect to a static response redirect_url = page_origin + "/resource-timing/resources/blank_page_green.htm" response.status = 302 diff --git a/tests/wpt/web-platform-tests/resources/chromium/image_capture.mojom.js b/tests/wpt/web-platform-tests/resources/chromium/image_capture.mojom.js index bf8dd16ca75..50428ffcb80 100644 --- a/tests/wpt/web-platform-tests/resources/chromium/image_capture.mojom.js +++ b/tests/wpt/web-platform-tests/resources/chromium/image_capture.mojom.js @@ -434,7 +434,7 @@ return err; var kVersionSizes = [ - {version: 0, numBytes: 16} + {version: 0, numBytes: 24} ]; err = messageValidator.validateStructVersion(offset, kVersionSizes); if (err !== validator.validationError.NONE) @@ -445,15 +445,15 @@ return validator.validationError.NONE; }; - Point2D.encodedSize = codec.kStructHeaderSize + 8; + Point2D.encodedSize = codec.kStructHeaderSize + 16; Point2D.decode = function(decoder) { var packed; var val = new Point2D(); var numberOfBytes = decoder.readUint32(); var version = decoder.readUint32(); - val.x = decoder.decodeStruct(codec.Float); - val.y = decoder.decodeStruct(codec.Float); + val.x = decoder.decodeStruct(codec.Double); + val.y = decoder.decodeStruct(codec.Double); return val; }; @@ -461,8 +461,8 @@ var packed; encoder.writeUint32(Point2D.encodedSize); encoder.writeUint32(0); - encoder.encodeStruct(codec.Float, val.x); - encoder.encodeStruct(codec.Float, val.y); + encoder.encodeStruct(codec.Double, val.x); + encoder.encodeStruct(codec.Double, val.y); }; function PhotoSettings(values) { this.initDefaults_(); diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/requirements.txt b/tests/wpt/web-platform-tests/tools/wptrunner/requirements.txt index 887068b34d2..4b568b74616 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/requirements.txt +++ b/tests/wpt/web-platform-tests/tools/wptrunner/requirements.txt @@ -3,6 +3,6 @@ mozinfo==1.1.0 mozlog==4.0 mozdebug==0.1.1 pillow==6.0.0 -urllib3[secure]==1.24.1 +urllib3[secure]==1.24.2 requests==2.21.0 six>=1.8 diff --git a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html index c5956e7f3d1..50a9d344541 100644 --- a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive.https.html @@ -9,6 +9,6 @@ "Tests requestSession resolves when supported", (session) => { assert_not_equals(session, null); - }, { supportsImmersive:true }, { mode: 'immersive-vr' }); + }, { supportsImmersive:true }, 'immersive-vr'); \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive_no_gesture.https.html b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive_no_gesture.https.html index c1b3286709d..eb5a4fda0bd 100644 --- a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive_no_gesture.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive_no_gesture.https.html @@ -9,7 +9,7 @@ (t) => { return XRTest.simulateDeviceConnection({ supportsImmersive:true }) .then( (controller) => promise_rejects( - t, 'SecurityError', navigator.xr.requestSession({ mode: 'immersive-vr' }))); + t, 'SecurityError', navigator.xr.requestSession('immersive-vr'))); }); diff --git a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive_unsupported.https.html b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive_unsupported.https.html index 60e9e6cc6e1..2592f3a4a0d 100644 --- a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive_unsupported.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_immersive_unsupported.https.html @@ -13,7 +13,7 @@ resolve(promise_rejects( t, "NotSupportedError", - navigator.xr.requestSession({ mode: 'immersive-vr' }) + navigator.xr.requestSession('immersive-vr') )) }); })); diff --git a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_no_mode.https.html b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_no_mode.https.html new file mode 100644 index 00000000000..c4ac3f6b6d7 --- /dev/null +++ b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_no_mode.https.html @@ -0,0 +1,22 @@ + + + + + + + diff --git a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html index 241b5ded0a5..40e6f4928b3 100644 --- a/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrDevice_requestSession_non_immersive_no_gesture.https.html @@ -8,9 +8,7 @@ "Requesting non-immersive session outside of a user gesture succeeds", (t) => { return XRTest.simulateDeviceConnection({ supportsImmersive:false }) - .then( (controller) => navigator.xr.requestSession({ - mode: 'inline' - })) + .then( (controller) => navigator.xr.requestSession('inline')) .then( (session) => { assert_not_equals(session, null); }); }); diff --git a/tests/wpt/web-platform-tests/webxr/xrFrame_getPose.https.html b/tests/wpt/web-platform-tests/webxr/xrFrame_getPose.https.html index 2c75275a112..a8015e3276a 100644 --- a/tests/wpt/web-platform-tests/webxr/xrFrame_getPose.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrFrame_getPose.https.html @@ -12,8 +12,6 @@ let immersiveTestName = "XRFrame.getPose works for immersive sessions"; let nonImmersiveTestName = "XRFrame.getPose works for non-immersive sessions"; let fakeDeviceInitParams = { supportsImmersive:true }; -let immersiveSessionOptions = { mode: 'immersive-vr' }; -let nonImmersiveSessionOptions = { outputContext: getOutputContext() }; let testFunction = function(session, fakeDeviceController, t) { // Need to have a valid pose or input events don't process. @@ -88,8 +86,8 @@ let testFunction = function(session, fakeDeviceController, t) { }; xr_session_promise_test(immersiveTestName, testFunction, - fakeDeviceInitParams, immersiveSessionOptions); + fakeDeviceInitParams, 'immersive-vr'); xr_session_promise_test(nonImmersiveTestName, testFunction, - fakeDeviceInitParams, nonImmersiveSessionOptions); + fakeDeviceInitParams, 'inline'); diff --git a/tests/wpt/web-platform-tests/webxr/xrFrame_lifetime.https.html b/tests/wpt/web-platform-tests/webxr/xrFrame_lifetime.https.html index 30cf5f99677..b924c89771e 100644 --- a/tests/wpt/web-platform-tests/webxr/xrFrame_lifetime.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrFrame_lifetime.https.html @@ -13,9 +13,6 @@ let fakeDeviceInitParams = { supportsImmersive:true }; - let immersiveSessionOptions = { mode: 'immersive-vr' }; - let nonImmersiveSessionOptions = { outputContext: getOutputContext() }; - let testFunction = (testSession, testController, t) => new Promise((resolve) => { let staleFrame = null; let currentReferenceSpace = null; @@ -48,9 +45,9 @@ }); xr_session_promise_test(immersiveTestName, testFunction, - fakeDeviceInitParams, immersiveSessionOptions); + fakeDeviceInitParams, 'immersive-vr'); xr_session_promise_test(nonImmersiveTestName, testFunction, - fakeDeviceInitParams, nonImmersiveSessionOptions); + fakeDeviceInitParams, 'inline'); \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/webxr/xrRigidTransform_constructor.https.html b/tests/wpt/web-platform-tests/webxr/xrRigidTransform_constructor.https.html index abaf8bf9ebe..15666973473 100644 --- a/tests/wpt/web-platform-tests/webxr/xrRigidTransform_constructor.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrRigidTransform_constructor.https.html @@ -9,7 +9,6 @@ let testName = "XRRigidTransform constructor works"; let fakeDeviceInitParams = { supportsImmersive: true }; -let requestSessionOptions = { mode: 'immersive-vr' }; let testFunction = (session, fakeDeviceController, t) => new Promise((resolve, reject) => { @@ -108,6 +107,6 @@ let testFunction = }); xr_session_promise_test(testName, testFunction, fakeDeviceInitParams, - requestSessionOptions); + 'immersive-vr'); diff --git a/tests/wpt/web-platform-tests/webxr/xrRigidTransform_inverse.https.html b/tests/wpt/web-platform-tests/webxr/xrRigidTransform_inverse.https.html index e795a99538e..da34fec60f0 100644 --- a/tests/wpt/web-platform-tests/webxr/xrRigidTransform_inverse.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrRigidTransform_inverse.https.html @@ -9,7 +9,6 @@ let testName = "XRRigidTransform inverse works"; let fakeDeviceInitParams = { supportsImmersive: true }; -let requestSessionOptions = { mode: 'immersive-vr' }; let testFunction = (session, fakeDeviceController, t) => new Promise((resolve, reject) => { @@ -103,6 +102,6 @@ let testFunction = }); xr_session_promise_test(testName, testFunction, fakeDeviceInitParams, - requestSessionOptions); + 'immersive-vr'); diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html index cc7b8802cba..d45349ad244 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_cancelAnimationFrame.https.html @@ -13,9 +13,6 @@ let fakeDeviceInitParams = { supportsImmersive:true }; - let immersiveSessionOptions = { mode: 'immersive-vr' }; - let nonImmersiveSessionOptions = { mode: 'inline' }; - let testFunction = (session) => new Promise((resolve, reject) => { // Schedule and immediately cancel animation frame @@ -49,9 +46,9 @@ }); xr_session_promise_test(immersiveTestName, testFunction, - fakeDeviceInitParams, immersiveSessionOptions); + fakeDeviceInitParams, 'immersive-vr'); xr_session_promise_test(nonImmersiveTestName, testFunction, - fakeDeviceInitParams, nonImmersiveSessionOptions); + fakeDeviceInitParams, 'inline'); diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html index e6a9c066543..b93f4e27909 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_cancelAnimationFrame_invalidhandle.https.html @@ -12,9 +12,6 @@ let fakeDeviceInitParams = { supportsImmersive:true }; - let immersiveSessionOptions = { mode: 'immersive-vr' }; - let nonImmersiveSessionOptions = { mode: 'inline' }; - let testFunction = (testSession) => new Promise((resolve) => { let counter = 0; @@ -37,9 +34,9 @@ }); xr_session_promise_test( - immersiveTestName, testFunction, fakeDeviceInitParams, immersiveSessionOptions); + immersiveTestName, testFunction, fakeDeviceInitParams, 'immersive-vr'); xr_session_promise_test( - nonImmersiveTestName, testFunction, fakeDeviceInitParams, nonImmersiveSessionOptions); + nonImmersiveTestName, testFunction, fakeDeviceInitParams, 'inline'); diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_end.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_end.https.html index 6365c7de508..26b6b47d2bf 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_end.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_end.https.html @@ -11,9 +11,6 @@ let watcherDone = new Event("watcherdone"); const fakeDeviceInitParams = { supportsImmersive:true }; - const immersiveSessionOptions = { mode: 'immersive-vr' }; - const nonImmersiveSessionOptions = { mode: 'inline' }; - let testFunction = function(session, testDeviceController, t) { let eventWatcher = new EventWatcher(t, session, ["end", "watcherdone"]); let eventPromise = eventWatcher.wait_for(["end", "watcherdone"]); @@ -31,8 +28,8 @@ }; xr_session_promise_test(immersivetestName, testFunction, - fakeDeviceInitParams, immersiveSessionOptions); + fakeDeviceInitParams, 'immersive-vr'); xr_session_promise_test(nonimmersiveTestName, testFunction, - fakeDeviceInitParams, nonImmersiveSessionOptions); + fakeDeviceInitParams, 'inline'); \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_identity_referenceSpace.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_identity_referenceSpace.https.html index fb18edf6ddd..07abc39728c 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_identity_referenceSpace.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_identity_referenceSpace.https.html @@ -14,9 +14,6 @@ let fakeDeviceInitParams = { supportsImmersive: true }; - let immersiveSessionOptions = { mode: 'immersive-vr' }; - let inlineSessionOptions = { mode: 'inline' }; - const identityMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; // Valid matrices for when we don't care about specific values @@ -80,9 +77,9 @@ }; xr_session_promise_test(inlineTestName, testFunction, - fakeDeviceInitParams, inlineSessionOptions); + fakeDeviceInitParams, 'inline'); xr_session_promise_test(immersiveTestName, testFunction, - fakeDeviceInitParams, immersiveSessionOptions); + fakeDeviceInitParams, 'immersive-vr'); diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_mode.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_mode.https.html index 4b54d948021..a1d06608439 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_mode.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_mode.https.html @@ -11,7 +11,7 @@ return XRTest.simulateDeviceConnection({ supportsImmersive:true }) .then( (controller) => new Promise((resolve) => { XRTest.simulateUserActivation( () => { - resolve(navigator.xr.requestSession({ mode: 'immersive-vr' }).then( (session) => { + resolve(navigator.xr.requestSession('immersive-vr').then( (session) => { assert_equals(session.mode, 'immersive-vr'); })); }); diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_prevent_multiple_exclusive.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_prevent_multiple_exclusive.https.html index c2e7f3bf444..e61bd392718 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_prevent_multiple_exclusive.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_prevent_multiple_exclusive.https.html @@ -12,7 +12,7 @@ return XRTest.simulateDeviceConnection({ supportsImmersive:true }) .then( (controller) => new Promise((resolve) => { XRTest.simulateUserActivation( () => { - resolve(navigator.xr.requestSession({ mode: 'immersive-vr' }) + resolve(navigator.xr.requestSession('immersive-vr') .then( (session) => new Promise((resolve) => { XRTest.simulateUserActivation( () => { // Requesting a second immersive session when another immersive @@ -22,13 +22,13 @@ resolve(promise_rejects( t, "InvalidStateError", - navigator.xr.requestSession({ mode: 'immersive-vr' }) + navigator.xr.requestSession('immersive-vr') ).then( () => { // End the immersive session and try again. Now the immersive // session creation should succeed. return session.end().then( () => new Promise((resolve) => { XRTest.simulateUserActivation( () => { - resolve(navigator.xr.requestSession({ mode: 'immersive-vr' })); + resolve(navigator.xr.requestSession('immersive-vr')); }); })); })); diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html index 92f7d1f79dc..2ed468bc3a5 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html @@ -13,9 +13,6 @@ let fakeDeviceInitParams = { supportsImmersive:true }; - let immersiveSessionOptions = { mode: 'immersive-vr' }; - let nonImmersiveSessionOptions = { mode: 'inline' }; - let testFunction = (testSession) => new Promise((resolve) => { function onFrame(time, xrFrame) { assert_true(xrFrame instanceof XRFrame); @@ -27,9 +24,9 @@ }); xr_session_promise_test(immersiveTestName, testFunction, - fakeDeviceInitParams, immersiveSessionOptions); + fakeDeviceInitParams, 'immersive-vr'); xr_session_promise_test(nonImmersiveTestName, testFunction, - fakeDeviceInitParams, nonImmersiveSessionOptions); + fakeDeviceInitParams, 'inline'); \ No newline at end of file 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 2278666a1d7..44e903e4fb9 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 @@ -28,7 +28,6 @@ }; const fakeDeviceInitOptions = { supportsImmersive:true }; - const sessionOptions = { mode: 'immersive-vr' }; let testSession; @@ -77,6 +76,6 @@ } xr_session_promise_test( - testName, testFunction, fakeDeviceInitOptions, sessionOptions); + testName, testFunction, fakeDeviceInitOptions, 'immersive-vr'); 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 8c8e26aa12d..5606fa1ab12 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 @@ -14,9 +14,6 @@ let fakeDeviceInitParams = { supportsImmersive: true }; - let immersiveSessionOptions = { mode: 'immersive-vr' }; - let nonImmersiveSessionOptions = { mode: 'inline' }; - // Valid matrices for when we don't care about specific values const validPoseMatrix = [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1]; const validProjectionMatrix = [1, 0, 0, 0, 0, 1, 0, 0, 3, 2, -1, -1, 0, 0, -0.2, 0]; @@ -71,9 +68,9 @@ }; xr_session_promise_test(nonImmersiveTestName, testFunction, - fakeDeviceInitParams, nonImmersiveSessionOptions); + fakeDeviceInitParams, 'inline'); xr_session_promise_test(immersiveTestName, testFunction, - fakeDeviceInitParams, immersiveSessionOptions); + fakeDeviceInitParams, 'immersive-vr'); diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html index ed31f372ceb..0027d5dce01 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html @@ -13,9 +13,6 @@ let fakeDeviceInitParams = { supportsImmersive: true }; - let immersiveSessionOptions = { mode: 'immersive-vr' }; - let nonImmersiveSessionOptions = { mode: 'inline' }; - 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" }))) @@ -75,9 +72,9 @@ }; xr_session_promise_test( - immersiveTestName, testFunction, fakeDeviceInitParams, immersiveSessionOptions); + immersiveTestName, testFunction, fakeDeviceInitParams, 'immersive-vr'); xr_session_promise_test( - nonImmersiveTestName, testFunction, fakeDeviceInitParams, nonImmersiveSessionOptions); + nonImmersiveTestName, testFunction, fakeDeviceInitParams, 'inline'); \ No newline at end of file diff --git a/tests/wpt/web-platform-tests/webxr/xrSession_transfer_outputContext.https.html b/tests/wpt/web-platform-tests/webxr/xrSession_transfer_outputContext.https.html index 658cb322487..759d97ba184 100644 --- a/tests/wpt/web-platform-tests/webxr/xrSession_transfer_outputContext.https.html +++ b/tests/wpt/web-platform-tests/webxr/xrSession_transfer_outputContext.https.html @@ -11,8 +11,8 @@ return XRTest.simulateDeviceConnection({ supportsImmersive:false }) .then( (controller) => { return Promise.all([ - navigator.xr.requestSession({ mode: 'inline'}), - navigator.xr.requestSession({ mode: 'inline'}) + navigator.xr.requestSession('inline'), + navigator.xr.requestSession('inline') ]).then((sessions) => { t.step(() => { assert_not_equals(sessions[0], null);