forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align our WPTs with the spec split by moving OPFS tests into a new fs/ directory. All Access Handle tests and most tests using a sandboxed file system backend have been moved to fs/. file-system-access/ contains all file picker tests and tests using a local file system backend, as well as tests which have not yet shipped (BaseHandle::remove() and DirHandle::move()). Bug: N/A Change-Id: I95ab81c7f19774d69bf72e8140d609e7f4abb32a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3550030 Commit-Queue: Austin Sullivan <[email protected]> Reviewed-by: Marijn Kruisselbrink <[email protected]> Cr-Commit-Position: refs/heads/main@{#999773}
- Loading branch information
1 parent
b98b119
commit 5798ab0
Showing
90 changed files
with
938 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
file-system-access/local_FileSystemDirectoryHandle-rename-manual.https.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
file-system-access/sandboxed_FileSystemBaseHandle-remove.https.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
file-system-access/sandboxed_FileSystemDirectoryHandle-move.https.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
// META: script=resources/test-helpers.js | ||
// META: script=resources/sandboxed-fs-test-helpers.js | ||
// META: script=../fs/resources/sandboxed-fs-test-helpers.js | ||
// META: script=script-tests/FileSystemDirectoryHandle-move.js |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
spec: https://fs.spec.whatwg.org/ | ||
suggested_reviewers: | ||
- mkruisselbrink | ||
- mkruisselbrink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This directory contains tests for the | ||
[File System](https://fs.spec.whatwg.org/) specification. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
'use strict'; | ||
|
||
const kSandboxWindowUrl = 'resources/opaque-origin-sandbox.html'; | ||
|
||
function add_iframe(test, src, sandbox) { | ||
const iframe = document.createElement('iframe'); | ||
iframe.src = src; | ||
if (sandbox !== undefined) { | ||
iframe.sandbox = sandbox; | ||
} | ||
document.body.appendChild(iframe); | ||
test.add_cleanup(() => { | ||
iframe.remove(); | ||
}); | ||
} | ||
|
||
// Creates a data URI iframe that uses postMessage() to provide its parent | ||
// with the test result. The iframe checks for the existence of | ||
// |property_name| on the window. | ||
async function verify_does_not_exist_in_data_uri_iframe( | ||
test, property_name) { | ||
const iframe_content = | ||
'<script>' + | ||
' const is_property_name_defined = ' + | ||
` (self.${property_name} !== undefined);` + | ||
' parent.postMessage({is_property_name_defined}, "*")' + | ||
'</script>'; | ||
|
||
const data_uri = `data:text/html,${encodeURIComponent(iframe_content)}`; | ||
add_iframe(test, data_uri); | ||
|
||
const event_watcher = new EventWatcher(test, self, 'message'); | ||
const message_event = await event_watcher.wait_for('message') | ||
|
||
assert_false(message_event.data.is_property_name_defined, | ||
`Data URI iframes must not define '${property_name}'.`); | ||
} | ||
|
||
// |kSandboxWindowUrl| sends the result of navigator.storage.getDirectory() to | ||
// this window. For windows using sandbox='allow-scripts', this must produce a | ||
// rejected promise. | ||
async function verify_results_from_sandboxed_child_window(test) { | ||
const event_watcher = new EventWatcher(test, self, 'message'); | ||
|
||
const message_event = await event_watcher.wait_for('message'); | ||
assert_equals(message_event.data, | ||
'navigator.storage.getDirectory(): REJECTED: SecurityError'); | ||
} | ||
|
||
promise_test(async test => { | ||
await verify_does_not_exist_in_data_uri_iframe( | ||
test, 'FileSystemDirectoryHandle'); | ||
}, 'FileSystemDirectoryHandle must be undefined for data URI iframes.'); | ||
|
||
promise_test( | ||
async test => { | ||
add_iframe(test, kSandboxWindowUrl, /*sandbox=*/ 'allow-scripts'); | ||
await verify_results_from_sandboxed_child_window(test); | ||
}, | ||
'navigator.storage.getDirectory() must reject in a sandboxed iframe.'); | ||
|
||
promise_test( | ||
async test => { | ||
const child_window_url = kSandboxWindowUrl + | ||
'?pipe=header(Content-Security-Policy, sandbox allow-scripts)'; | ||
|
||
const child_window = window.open(child_window_url); | ||
test.add_cleanup(() => { | ||
child_window.close(); | ||
}); | ||
|
||
await verify_results_from_sandboxed_child_window(test); | ||
}, | ||
'navigator.storage.getDirectory() ' + | ||
'must reject in a sandboxed opened window.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
importScripts( | ||
'test-helpers.js', | ||
'messaging-serialize-helpers.js', | ||
'message-target.js' | ||
); | ||
|
||
add_message_event_handlers(/*receiver=*/self, /*target=*/self); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
importScripts( | ||
'test-helpers.js', | ||
'messaging-serialize-helpers.js', | ||
'message-target.js' | ||
); | ||
|
||
add_message_event_handlers(/*receiver=*/self); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
importScripts( | ||
'test-helpers.js', | ||
'messaging-serialize-helpers.js', | ||
'message-target.js' | ||
); | ||
|
||
self.addEventListener('connect', connect_event => { | ||
const message_port = connect_event.ports[0]; | ||
add_message_event_handlers( | ||
/*receiver=*/message_port, /*target=*/message_port); | ||
message_port.start(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<script src='test-helpers.js'></script> | ||
<script src='messaging-serialize-helpers.js'></script> | ||
<script src='message-target.js'></script> | ||
<script id="inline_script"> | ||
'use strict' | ||
|
||
if (window.parent !== null) { | ||
window.parent.postMessage('LOADED', { targetOrigin: '*' }); | ||
} | ||
|
||
if (window.opener !== null) { | ||
window.opener.postMessage('LOADED', { targetOrigin: '*' }); | ||
} | ||
|
||
// Use an undefined message target to send responses to | ||
// MessageEvent::source instead. | ||
const target = undefined; | ||
|
||
add_message_event_handlers( | ||
/*receiver=*/self, target, /*target_origin=*/'*'); | ||
</script> |
Oops, something went wrong.