Skip to content

Commit

Permalink
Synchronize FileAPI WPT
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=274457

Reviewed by Tim Nguyen.

Quite a few caveats unfortunately:

- Ignore a test change with Float16Array for now as it would reduce coverage.
- BlobURL/cross-partition.tentative.https.html is not imported for now.
- blob/Blob-methods-from-detached-frame.html is removed as we exported it as
  Blob-methods-from-detached-frame.html and imported that one at a later point.
  So in effect this deduplicates it.
- Many -expected.txt files are removed because --clean-dest-dir was not used
  during prior imports.
- A change to FileAPI/url/multi-global-origin-serialization.sub.html is ignored
  for now.

Latest upstream commit for this directory:
web-platform-tests/wpt@5aa50dd

* LayoutTests/imported/w3c/resources/resource-files.json:
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReader/Progress_event_bubbles_cancelable-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReader/Progress_event_bubbles_cancelable.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/META.yml:
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-methods-from-detached-frame-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-methods-from-detached-frame.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-slice-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-slice-overflow-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream-byob-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream-sync-xhr-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.js:
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/w3c-import.log:
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-formdata-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/send-file-formdata-utf-8-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/fileReader-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/Determining-Encoding-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/FileReader-event-handler-attributes-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/FileReader-multiple-reads-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_abort-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_error-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsArrayBuffer-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsBinaryString-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsText-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readystate-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_result-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-format.any.js:
(test.t.t.add_cleanup):
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.js:
(async garbageCollect.else.gcRec): Deleted.
(async garbageCollect): Deleted.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url_xmlhttprequest_img-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/w3c-import.log:
* LayoutTests/tests-options.json:

Canonical link: https://commits.webkit.org/279121@main
  • Loading branch information
annevk committed May 22, 2024
1 parent 19f5b89 commit 0b25769
Show file tree
Hide file tree
Showing 36 changed files with 104 additions and 427 deletions.
1 change: 0 additions & 1 deletion LayoutTests/imported/w3c/resources/resource-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,6 @@
"shadow-dom/untriaged/shadow-trees/shadow-root-001-ref.html",
"shadow-dom/untriaged/shadow-trees/shadow-root-002-ref.html",
"shadow-dom/untriaged/styles/not-apply-in-shadow-root-001-ref.html",
"web-platform-tests/FileAPI/BlobURL/support/file_test3.html",
"web-platform-tests/FileAPI/support/document-domain-setter.sub.html",
"web-platform-tests/FileAPI/support/empty-document.html",
"web-platform-tests/FileAPI/support/incumbent.sub.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

PASS Check the values of bubbles and cancelable are false when the progress event is dispatched

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>File API Test: Progress Event - bubbles, cancelable</title>
<link rel="author" title="Intel" href="http://www.intel.com">
<link rel="help" href="http://www.w3.org/TR/FileAPI/#events">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
async_test(function(){
var blob = new Blob(["TEST"]);
var reader = new FileReader();

reader.onloadstart = this.step_func(function(evt) {
assert_false(evt.bubbles, "The bubbles must be false when the event is dispatched");
assert_false(evt.cancelable, "The cancelable must be false when the event is dispatched");
});

reader.onload = this.step_func(function(evt) {
assert_false(evt.bubbles, "The bubbles must be false when the event is dispatched");
assert_false(evt.cancelable, "The cancelable must be false when the event is dispatched");
});

reader.onloadend = this.step_func(function(evt) {
assert_false(evt.bubbles, "The bubbles must be false when the event is dispatched");
assert_false(evt.cancelable, "The cancelable must be false when the event is dispatched");
this.done();
});

reader.readAsText(blob);
}, "Check the values of bubbles and cancelable are false when the progress event is dispatched");
</script>

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spec: https://w3c.github.io/FileAPI/
suggested_reviewers:
- inexorabletash
- zqzhang
- jdm
- mkruisselbrink
- annevk

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<script type="module">
let a = new Blob(['', '', undefined], { })
let b = a.stream()
let c = new ReadableStreamBYOBReader(b)
let d = new Int16Array(8)
await c.read(d)
c.releaseLock()
await a.text()
await b.cancel()
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<script>
const blob = new Blob([1, 2]);
const readable = blob.stream()
const writable = new WritableStream({}, {
size() {
let xhr = new XMLHttpRequest()
xhr.open("POST", "1", false)
xhr.send()
}
})
readable.pipeThrough({ readable, writable })
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
PASS Blob.stream()
PASS Blob.stream() empty Blob
PASS Blob.stream() non-unicode input
PASS Blob.stream() garbage collection of blob shouldn't break streamconsumption
PASS Blob.stream() garbage collection of blob shouldn't break stream consumption
PASS Blob.stream() garbage collection of stream shouldn't break stream consumption
FAIL Reading Blob.stream() with BYOB reader promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader needs a ReadableByteStreamController"

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,18 @@ promise_test(async() => {
await garbageCollect();
const chunks = await read_all_chunks(stream, { perform_gc: true });
assert_array_equals(chunks, input_arr);
}, "Blob.stream() garbage collection of blob shouldn't break stream" +
}, "Blob.stream() garbage collection of blob shouldn't break stream " +
"consumption")

promise_test(async() => {
const input_arr = [8, 241, 48, 123, 151];
const typed_arr = new Uint8Array(input_arr);
let blob = new Blob([typed_arr]);
const chunksPromise = read_all_chunks(blob.stream());
// It somehow matters to do GC here instead of doing `perform_gc: true`
await garbageCollect();
assert_array_equals(await chunksPromise, input_arr);
}, "Blob.stream() garbage collection of stream shouldn't break stream " +
"consumption")

promise_test(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
PASS Blob.stream()
PASS Blob.stream() empty Blob
PASS Blob.stream() non-unicode input
PASS Blob.stream() garbage collection of blob shouldn't break streamconsumption
PASS Blob.stream() garbage collection of blob shouldn't break stream consumption
PASS Blob.stream() garbage collection of stream shouldn't break stream consumption
FAIL Reading Blob.stream() with BYOB reader promise_test: Unhandled rejection with value: object "TypeError: ReadableStreamBYOBReader needs a ReadableByteStreamController"

Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ List of files:
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-in-worker.worker.js
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-slice-overflow.any.js
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-slice.any.js
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream-byob-crash.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream-sync-xhr-crash.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.js
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.js
Loading

0 comments on commit 0b25769

Please sign in to comment.