Diff
Modified: trunk/LayoutTests/ChangeLog (263058 => 263059)
--- trunk/LayoutTests/ChangeLog 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/ChangeLog 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,3 +1,13 @@
+2020-06-15 Tetsuharu Ohzeki <[email protected]>
+
+ Update WPT tests for FileAPI
+ https://bugs.webkit.org/show_bug.cgi?id=213198
+
+ Reviewed by Alex Christensen.
+
+ * platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub-expected.txt: Added.
+ * tests-options.json:
+
2020-06-15 Jason Lawrence <[email protected]>
[ Mojave wk2 Release ] webgl/2.0.0/conformance2/textures/canvas_sub_rectangle/tex-2d-rgb16f-rgb-half_float.html is flaky failing.
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,3 +1,91 @@
+2020-06-15 Tetsuharu Ohzeki <[email protected]>
+
+ Update WPT tests for FileAPI
+ https://bugs.webkit.org/show_bug.cgi?id=213198
+
+ Reviewed by Alex Christensen.
+
+ Import from 90446389b82ae924cdef637bca2dd99ece41160c
+
+ * web-platform-tests/FileAPI/BlobURL/support/w3c-import.log:
+ * web-platform-tests/FileAPI/FileReader/support/w3c-import.log:
+ * web-platform-tests/FileAPI/FileReader/w3c-import.log:
+ * web-platform-tests/FileAPI/FileReaderSync.worker-expected.txt:
+ * web-platform-tests/FileAPI/FileReaderSync.worker.js:
+ (setup):
+ (test):
+ * web-platform-tests/FileAPI/META.yml: Added.
+ * web-platform-tests/FileAPI/OWNERS: Removed.
+ * web-platform-tests/FileAPI/blob/Blob-array-buffer.any-expected.txt: Added.
+ * web-platform-tests/FileAPI/blob/Blob-array-buffer.any.html: Added.
+ * web-platform-tests/FileAPI/blob/Blob-array-buffer.any.js: Added.
+ (string_appeared_here.promise_test.async const):
+ * web-platform-tests/FileAPI/blob/Blob-array-buffer.any.worker-expected.txt: Added.
+ * web-platform-tests/FileAPI/blob/Blob-array-buffer.any.worker.html: Added.
+ * web-platform-tests/FileAPI/blob/Blob-constructor-endings.html:
+ * web-platform-tests/FileAPI/blob/Blob-constructor.html:
+ * web-platform-tests/FileAPI/blob/Blob-stream.any-expected.txt: Added.
+ * web-platform-tests/FileAPI/blob/Blob-stream.any.html: Added.
+ * web-platform-tests/FileAPI/blob/Blob-stream.any.js: Added.
+ (async read_all_chunks):
+ (promise_test.async const):
+ (promise_test):
+ * web-platform-tests/FileAPI/blob/Blob-stream.any.worker-expected.txt: Added.
+ * web-platform-tests/FileAPI/blob/Blob-stream.any.worker.html: Added.
+ * web-platform-tests/FileAPI/blob/Blob-text.any-expected.txt: Added.
+ * web-platform-tests/FileAPI/blob/Blob-text.any.html: Added.
+ * web-platform-tests/FileAPI/blob/Blob-text.any.js: Added.
+ (string_appeared_here.promise_test.async const):
+ * web-platform-tests/FileAPI/blob/Blob-text.any.worker-expected.txt: Added.
+ * web-platform-tests/FileAPI/blob/Blob-text.any.worker.html: Added.
+ * web-platform-tests/FileAPI/blob/w3c-import.log:
+ * web-platform-tests/FileAPI/file/File-constructor-endings.html:
+ * web-platform-tests/FileAPI/file/File-constructor.html:
+ * web-platform-tests/FileAPI/file/w3c-import.log:
+ * web-platform-tests/FileAPI/filelist-section/support/w3c-import.log:
+ * web-platform-tests/FileAPI/filelist-section/w3c-import.log:
+ * web-platform-tests/FileAPI/idlharness.html:
+ * web-platform-tests/FileAPI/idlharness.worker.js:
+ * web-platform-tests/FileAPI/reading-data-section/FileReader-multiple-reads.html:
+ * web-platform-tests/FileAPI/reading-data-section/filereader_abort-expected.txt:
+ * web-platform-tests/FileAPI/reading-data-section/filereader_events.any-expected.txt: Added.
+ * web-platform-tests/FileAPI/reading-data-section/filereader_events.any.html: Added.
+ * web-platform-tests/FileAPI/reading-data-section/filereader_events.any.js: Added.
+ (promise_test.async t):
+ * web-platform-tests/FileAPI/reading-data-section/filereader_events.any.worker-expected.txt: Added.
+ * web-platform-tests/FileAPI/reading-data-section/filereader_events.any.worker.html: Added.
+ * web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL-expected.txt:
+ * web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL.html:
+ * web-platform-tests/FileAPI/reading-data-section/filereader_result-expected.txt:
+ * web-platform-tests/FileAPI/reading-data-section/filereader_result.html:
+ * web-platform-tests/FileAPI/reading-data-section/support/w3c-import.log:
+ * web-platform-tests/FileAPI/reading-data-section/w3c-import.log:
+ * web-platform-tests/FileAPI/support/Blob.js:
+ (self.assert_equals_typed_array):
+ (test_blob): Deleted.
+ * web-platform-tests/FileAPI/support/w3c-import.log:
+ * web-platform-tests/FileAPI/url/cross-global-revoke.sub.html:
+ * web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub-expected.txt:
+ * web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub.html:
+ * web-platform-tests/FileAPI/url/resources/revoke-helper.js:
+ * web-platform-tests/FileAPI/url/resources/w3c-import.log:
+ * web-platform-tests/FileAPI/url/sandboxed-iframe-expected.txt:
+ * web-platform-tests/FileAPI/url/sandboxed-iframe.html:
+ * web-platform-tests/FileAPI/url/url-format.any.js:
+ * web-platform-tests/FileAPI/url/url-in-tags-revoke.window-expected.txt: Added.
+ * web-platform-tests/FileAPI/url/url-in-tags-revoke.window.html: Added.
+ * web-platform-tests/FileAPI/url/url-in-tags-revoke.window.js:
+ (async_test.t.const.blob.new.Blob.window_contents_for_channel):
+ * web-platform-tests/FileAPI/url/url-in-tags.window-expected.txt: Added.
+ * web-platform-tests/FileAPI/url/url-in-tags.window.html: Added.
+ * web-platform-tests/FileAPI/url/url-lifetime.html:
+ * web-platform-tests/FileAPI/url/url-reload.window-expected.txt: Added.
+ * web-platform-tests/FileAPI/url/url-reload.window.html: Added.
+ * web-platform-tests/FileAPI/url/url-with-fetch.any.js:
+ * web-platform-tests/FileAPI/url/url_xmlhttprequest-expected.txt: Removed.
+ * web-platform-tests/FileAPI/url/w3c-import.log:
+ * web-platform-tests/FileAPI/w3c-import.log:
+
2020-06-14 Sergio Villar Senin <[email protected]>
Unreviewed, reverting r262124.
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/BlobURL/support/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/BlobURL/support/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/BlobURL/support/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReader/support/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReader/support/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReader/support/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReader/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReader/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReader/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReaderSync.worker-expected.txt (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReaderSync.worker-expected.txt 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReaderSync.worker-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,6 +1,11 @@
PASS Interface
PASS readAsText
+PASS readAsText with empty blob
PASS readAsDataURL
+PASS readAsDataURL with empty blob
+PASS readAsBinaryString
+PASS readAsBinaryString with empty blob
PASS readAsArrayBuffer
+PASS readAsArrayBuffer with empty blob
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReaderSync.worker.js (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReaderSync.worker.js 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReaderSync.worker.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,28 +1,56 @@
importScripts("/resources/testharness.js");
-var blob, readerSync;
-setup(function() {
- readerSync = new FileReaderSync();
- blob = new Blob(["test"]);
+var blob, empty_blob, readerSync;
+setup(() => {
+ readerSync = new FileReaderSync();
+ blob = new Blob(["test"]);
+ empty_blob = new Blob();
});
-test(function() {
- assert_true(readerSync instanceof FileReaderSync);
+test(() => {
+ assert_true(readerSync instanceof FileReaderSync);
}, "Interface");
-test(function() {
- var text = readerSync.readAsText(blob);
- assert_equals(text, "test");
+test(() => {
+ var text = readerSync.readAsText(blob);
+ assert_equals(text, "test");
}, "readAsText");
-test(function() {
- var data = ""
- assert_equals(data.indexOf("data:"), 0);
+test(() => {
+ var text = readerSync.readAsText(empty_blob);
+ assert_equals(text, "");
+}, "readAsText with empty blob");
+
+test(() => {
+ var data = ""
+ assert_equals(data.indexOf("data:"), 0);
}, "readAsDataURL");
-test(function() {
- var data = ""
- assert_true(data instanceof ArrayBuffer);
+test(() => {
+ var data = ""
+ assert_equals(data.indexOf("data:"), 0);
+}, "readAsDataURL with empty blob");
+
+test(() => {
+ var data = ""
+ assert_equals(data, "test");
+}, "readAsBinaryString");
+
+test(() => {
+ var data = ""
+ assert_equals(data, "");
+}, "readAsBinaryString with empty blob");
+
+test(() => {
+ var data = ""
+ assert_true(data instanceof ArrayBuffer);
+ assert_equals(data.byteLength, "test".length);
}, "readAsArrayBuffer");
+test(() => {
+ var data = ""
+ assert_true(data instanceof ArrayBuffer);
+ assert_equals(data.byteLength, 0);
+}, "readAsArrayBuffer with empty blob");
+
done();
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/META.yml (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/META.yml (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/META.yml 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,6 @@
+spec: https://w3c.github.io/FileAPI/
+suggested_reviewers:
+ - inexorabletash
+ - zqzhang
+ - jdm
+ - mkruisselbrink
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/OWNERS (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/OWNERS 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/OWNERS 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,4 +0,0 @@
-@inexorabletash
-@zqzhang
-@jdm
-@mkruisselbrink
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,7 @@
+
+FAIL Blob.arrayBuffer() promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+FAIL Blob.arrayBuffer() empty Blob data promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+FAIL Blob.arrayBuffer() non-ascii input promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+FAIL Blob.arrayBuffer() non-unicode input promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+FAIL Blob.arrayBuffer() concurrent reads promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.js (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,45 @@
+// META: title=Blob Array Buffer
+// META: script=../support/Blob.js
+'use strict';
+
+promise_test(async () => {
+ const input_arr = new TextEncoder().encode("PASS");
+ const blob = new Blob([input_arr]);
+ const array_buffer = await blob.arrayBuffer();
+ assert_true(array_buffer instanceof ArrayBuffer);
+ assert_equals_typed_array(new Uint8Array(array_buffer), input_arr);
+}, "Blob.arrayBuffer()")
+
+promise_test(async () => {
+ const input_arr = new TextEncoder().encode("");
+ const blob = new Blob([input_arr]);
+ const array_buffer = await blob.arrayBuffer();
+ assert_true(array_buffer instanceof ArrayBuffer);
+ assert_equals_typed_array(new Uint8Array(array_buffer), input_arr);
+}, "Blob.arrayBuffer() empty Blob data")
+
+promise_test(async () => {
+ const input_arr = new TextEncoder().encode("\u08B8\u000a");
+ const blob = new Blob([input_arr]);
+ const array_buffer = await blob.arrayBuffer();
+ assert_equals_typed_array(new Uint8Array(array_buffer), input_arr);
+}, "Blob.arrayBuffer() non-ascii input")
+
+promise_test(async () => {
+ const input_arr = [8, 241, 48, 123, 151];
+ const typed_arr = new Uint8Array(input_arr);
+ const blob = new Blob([typed_arr]);
+ const array_buffer = await blob.arrayBuffer();
+ assert_equals_typed_array(new Uint8Array(array_buffer), typed_arr);
+}, "Blob.arrayBuffer() non-unicode input")
+
+promise_test(async () => {
+ const input_arr = new TextEncoder().encode("PASS");
+ const blob = new Blob([input_arr]);
+ const array_buffer_results = await Promise.all([blob.arrayBuffer(),
+ blob.arrayBuffer(), blob.arrayBuffer()]);
+ for (let array_buffer of array_buffer_results) {
+ assert_true(array_buffer instanceof ArrayBuffer);
+ assert_equals_typed_array(new Uint8Array(array_buffer), input_arr);
+ }
+}, "Blob.arrayBuffer() concurrent reads")
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.worker-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.worker-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,7 @@
+
+FAIL Blob.arrayBuffer() promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+FAIL Blob.arrayBuffer() empty Blob data promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+FAIL Blob.arrayBuffer() non-ascii input promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+FAIL Blob.arrayBuffer() non-unicode input promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+FAIL Blob.arrayBuffer() concurrent reads promise_test: Unhandled rejection with value: object "TypeError: blob.arrayBuffer is not a function. (In 'blob.arrayBuffer()', 'blob.arrayBuffer' is undefined)"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.worker.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.worker.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor-endings.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor-endings.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor-endings.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -36,13 +36,13 @@
0,
{}
].forEach(value => test(t => {
- assert_throws(new TypeError(), () => new Blob([], {endings: value}),
- 'Blob constructor should throw');
+ assert_throws_js(TypeError, () => new Blob([], {endings: value}),
+ 'Blob constructor should throw');
}, `Invalid "endings" value: ${JSON.stringify(value)}`));
test(t => {
const test_error = {name: 'test'};
- assert_throws(
+ assert_throws_exactly(
test_error,
() => new Blob([], { get endings() { throw test_error; }}),
'Blob constructor should propagate exceptions from "endings" property');
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -25,7 +25,7 @@
assert_equals(blob.type, "");
}, "Blob constructor with no arguments");
test(function() {
- assert_throws(new TypeError(), function() { var blob = Blob(); });
+ assert_throws_js(TypeError, function() { var blob = Blob(); });
}, "Blob constructor with no arguments, without 'new'");
test(function() {
var blob = new Blob;
@@ -59,7 +59,7 @@
window,
];
args.forEach(function(arg) {
- assert_throws(new TypeError(), function() {
+ assert_throws_js(TypeError, function() {
new Blob(arg);
}, "Should throw for argument " + format_value(arg) + ".");
});
@@ -124,7 +124,7 @@
[Symbol.iterator]: Array.prototype[Symbol.iterator],
get length() { throw test_error; }
};
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
new Blob(obj);
});
}, "The length getter should be invoked and any exceptions should be propagated.");
@@ -137,13 +137,13 @@
Object.defineProperty(list, "length", {
get: function() { throw test_error; }
});
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
new Blob(list);
});
}, "A platform object that supports indexed properties should be treated as a sequence for the blobParts argument (overwritten 'length'.)");
test(function() {
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
var obj = {
[Symbol.iterator]: Array.prototype[Symbol.iterator],
length: {
@@ -153,7 +153,7 @@
};
new Blob(obj);
});
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
var obj = {
[Symbol.iterator]: Array.prototype[Symbol.iterator],
length: { valueOf: function() { throw test_error; } }
@@ -196,7 +196,7 @@
assert_unreached("Should not call the getter for 2 if the getter for 1 threw.");
}
};
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
new Blob(obj);
});
assert_array_equals(received, [
@@ -214,19 +214,19 @@
// XXX should add tests edge cases of ToLength(length)
test(function() {
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
new Blob([{ toString: function() { throw test_error; } }]);
}, "Throwing toString");
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
new Blob([{ toString: undefined, valueOf: function() { throw test_error; } }]);
}, "Throwing valueOf");
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
new Blob([{
toString: function() { throw test_error; },
valueOf: function() { assert_unreached("Should not call valueOf if toString is present."); }
}]);
}, "Throwing toString and valueOf");
- assert_throws(new TypeError(), function() {
+ assert_throws_js(TypeError, function() {
new Blob([{toString: null, valueOf: null}]);
}, "Null toString and valueOf");
}, "ToString should be called on elements of the blobParts array and any exceptions should be propagated.");
@@ -423,7 +423,7 @@
}, "options properties should be accessed in lexicographic order.");
test(function() {
- assert_throws(test_error, function() {
+ assert_throws_exactly(test_error, function() {
new Blob(
[{ toString: function() { throw test_error } }],
{
@@ -464,8 +464,8 @@
'abc'
].forEach(arg => {
test(t => {
- assert_throws(new TypeError(), () => new Blob([], arg),
- 'Blob constructor should throw with invalid property bag');
+ assert_throws_js(TypeError, () => new Blob([], arg),
+ 'Blob constructor should throw with invalid property bag');
}, `Passing ${JSON.stringify(arg)} for options should throw`);
});
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,6 @@
+
+FAIL Blob.stream() promise_test: Unhandled rejection with value: object "TypeError: blob.stream is not a function. (In 'blob.stream()', 'blob.stream' is undefined)"
+FAIL Blob.stream() empty Blob promise_test: Unhandled rejection with value: object "TypeError: blob.stream is not a function. (In 'blob.stream()', 'blob.stream' is undefined)"
+FAIL Blob.stream() non-unicode input promise_test: Unhandled rejection with value: object "TypeError: blob.stream is not a function. (In 'blob.stream()', 'blob.stream' is undefined)"
+FAIL Blob.stream() garbage collection of blob shouldn't break streamconsumption promise_test: Unhandled rejection with value: object "TypeError: blob.stream is not a function. (In 'blob.stream()', 'blob.stream' is undefined)"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.js (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,62 @@
+// META: title=Blob Stream
+// META: script=../support/Blob.js
+// META: script=../../streams/resources/test-utils.js
+'use strict';
+
+// Takes in a ReadableStream and reads from it until it is done, returning
+// an array that contains the results of each read operation
+async function read_all_chunks(stream) {
+ assert_true(stream instanceof ReadableStream);
+ assert_true('getReader' in stream);
+ const reader = stream.getReader();
+
+ assert_true('read' in reader);
+ let read_value = await reader.read();
+
+ let out = [];
+ let i = 0;
+ while (!read_value.done) {
+ for (let val of read_value.value) {
+ out[i++] = val;
+ }
+ read_value = await reader.read();
+ }
+ return out;
+}
+
+promise_test(async () => {
+ const blob = new Blob(["PASS"]);
+ const stream = blob.stream();
+ const chunks = await read_all_chunks(stream);
+ for (let [index, value] of chunks.entries()) {
+ assert_equals(value, "PASS".charCodeAt(index));
+ }
+}, "Blob.stream()")
+
+promise_test(async () => {
+ const blob = new Blob();
+ const stream = blob.stream();
+ const chunks = await read_all_chunks(stream);
+ assert_array_equals(chunks, []);
+}, "Blob.stream() empty Blob")
+
+promise_test(async () => {
+ const input_arr = [8, 241, 48, 123, 151];
+ const typed_arr = new Uint8Array(input_arr);
+ const blob = new Blob([typed_arr]);
+ const stream = blob.stream();
+ const chunks = await read_all_chunks(stream);
+ assert_array_equals(chunks, input_arr);
+}, "Blob.stream() non-unicode input")
+
+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 stream = blob.stream();
+ blob = null;
+ garbageCollect();
+ const chunks = await read_all_chunks(stream);
+ assert_array_equals(chunks, input_arr);
+}, "Blob.stream() garbage collection of blob shouldn't break stream" +
+ "consumption")
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.worker-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.worker-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,6 @@
+
+FAIL Blob.stream() promise_test: Unhandled rejection with value: object "TypeError: blob.stream is not a function. (In 'blob.stream()', 'blob.stream' is undefined)"
+FAIL Blob.stream() empty Blob promise_test: Unhandled rejection with value: object "TypeError: blob.stream is not a function. (In 'blob.stream()', 'blob.stream' is undefined)"
+FAIL Blob.stream() non-unicode input promise_test: Unhandled rejection with value: object "TypeError: blob.stream is not a function. (In 'blob.stream()', 'blob.stream' is undefined)"
+FAIL Blob.stream() garbage collection of blob shouldn't break streamconsumption promise_test: Unhandled rejection with value: object "TypeError: blob.stream is not a function. (In 'blob.stream()', 'blob.stream' is undefined)"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.worker.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-stream.any.worker.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,10 @@
+
+FAIL Blob.text() promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() empty blob data promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() multi-element array in constructor promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() non-unicode promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() different charset param in type option promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() different charset param with non-ascii input promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() invalid utf-8 input promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() concurrent reads promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.js (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,64 @@
+// META: title=Blob Text
+// META: script=../support/Blob.js
+'use strict';
+
+promise_test(async () => {
+ const blob = new Blob(["PASS"]);
+ const text = await blob.text();
+ assert_equals(text, "PASS");
+}, "Blob.text()")
+
+promise_test(async () => {
+ const blob = new Blob();
+ const text = await blob.text();
+ assert_equals(text, "");
+}, "Blob.text() empty blob data")
+
+promise_test(async () => {
+ const blob = new Blob(["P", "A", "SS"]);
+ const text = await blob.text();
+ assert_equals(text, "PASS");
+}, "Blob.text() multi-element array in constructor")
+
+promise_test(async () => {
+ const non_unicode = "\u0061\u030A";
+ const input_arr = new TextEncoder().encode(non_unicode);
+ const blob = new Blob([input_arr]);
+ const text = await blob.text();
+ assert_equals(text, non_unicode);
+}, "Blob.text() non-unicode")
+
+promise_test(async () => {
+ const blob = new Blob(["PASS"], { type: "text/plain;charset=utf-16le" });
+ const text = await blob.text();
+ assert_equals(text, "PASS");
+}, "Blob.text() different charset param in type option")
+
+promise_test(async () => {
+ const non_unicode = "\u0061\u030A";
+ const input_arr = new TextEncoder().encode(non_unicode);
+ const blob = new Blob([input_arr], { type: "text/plain;charset=utf-16le" });
+ const text = await blob.text();
+ assert_equals(text, non_unicode);
+}, "Blob.text() different charset param with non-ascii input")
+
+promise_test(async () => {
+ const input_arr = new Uint8Array([192, 193, 245, 246, 247, 248, 249, 250, 251,
+ 252, 253, 254, 255]);
+ const blob = new Blob([input_arr]);
+ const text = await blob.text();
+ assert_equals(text, "\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd" +
+ "\ufffd\ufffd\ufffd\ufffd");
+}, "Blob.text() invalid utf-8 input")
+
+promise_test(async () => {
+ const input_arr = new Uint8Array([192, 193, 245, 246, 247, 248, 249, 250, 251,
+ 252, 253, 254, 255]);
+ const blob = new Blob([input_arr]);
+ const text_results = await Promise.all([blob.text(), blob.text(),
+ blob.text()]);
+ for (let text of text_results) {
+ assert_equals(text, "\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd" +
+ "\ufffd\ufffd\ufffd\ufffd");
+ }
+}, "Blob.text() concurrent reads")
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.worker-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.worker-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,10 @@
+
+FAIL Blob.text() promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() empty blob data promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() multi-element array in constructor promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() non-unicode promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() different charset param in type option promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() different charset param with non-ascii input promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() invalid utf-8 input promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+FAIL Blob.text() concurrent reads promise_test: Unhandled rejection with value: object "TypeError: blob.text is not a function. (In 'blob.text()', 'blob.text' is undefined)"
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.worker.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-text.any.worker.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
@@ -14,8 +14,11 @@
None
------------------------------------------------------------------------
List of files:
+/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-array-buffer.any.js
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor-endings.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-constructor.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-in-worker.worker.js
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-slice-overflow.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/blob/Blob-slice.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
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor-endings.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor-endings.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor-endings.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -36,13 +36,13 @@
0,
{}
].forEach(value => test(t => {
- assert_throws(new TypeError(), () => new File([], "name", {endings: value}),
- 'File constructor should throw');
+ assert_throws_js(TypeError, () => new File([], "name", {endings: value}),
+ 'File constructor should throw');
}, `Invalid "endings" value: ${JSON.stringify(value)}`));
test(t => {
const test_error = {name: 'test'};
- assert_throws(
+ assert_throws_exactly(
test_error,
() => new File([], "name", { get endings() { throw test_error; }}),
'File constructor should propagate exceptions from "endings" property');
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/File-constructor.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -14,10 +14,10 @@
}, "File interface object exists");
test(t => {
- assert_throws(new TypeError(), () => new File(),
- 'Bits argument is required');
- assert_throws(new TypeError(), () => new File([]),
- 'Name argument is required');
+ assert_throws_js(TypeError, () => new File(),
+ 'Bits argument is required');
+ assert_throws_js(TypeError, () => new File([]),
+ 'Name argument is required');
}, 'Required arguments');
function test_first_argument(arg1, expectedSize, testName) {
@@ -64,14 +64,14 @@
null
].forEach(arg => {
test(t => {
- assert_throws(new TypeError(), () => new File(arg, 'world.html'),
- 'Constructor should throw for invalid bits argument');
+ assert_throws_js(TypeError, () => new File(arg, 'world.html'),
+ 'Constructor should throw for invalid bits argument');
}, `Invalid bits argument: ${JSON.stringify(arg)}`);
});
test(t => {
- assert_throws(new Error(), () => new File([to_string_throws], 'name.txt'),
- 'Constructor should propagate exceptions');
+ assert_throws_js(Error, () => new File([to_string_throws], 'name.txt'),
+ 'Constructor should propagate exceptions');
}, 'Bits argument: object that throws');
@@ -131,8 +131,8 @@
'abc'
].forEach(arg => {
test(t => {
- assert_throws(new TypeError(), () => new File(['bits'], 'name.txt', arg),
- 'Constructor should throw for invalid property bag type');
+ assert_throws_js(TypeError, () => new File(['bits'], 'name.txt', arg),
+ 'Constructor should throw for invalid property bag type');
}, `Invalid property bag: ${JSON.stringify(arg)}`);
});
@@ -150,9 +150,9 @@
});
test(t => {
- assert_throws(new Error(),
- () => new File(['bits'], 'name.txt', {type: to_string_throws}),
- 'Constructor should propagate exceptions');
+ assert_throws_js(Error,
+ () => new File(['bits'], 'name.txt', {type: to_string_throws}),
+ 'Constructor should propagate exceptions');
}, 'Property bag propagates exceptions');
</script>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/file/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/filelist-section/support/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/filelist-section/support/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/filelist-section/support/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/filelist-section/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/filelist-section/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/filelist-section/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/idlharness.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/idlharness.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/idlharness.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -26,9 +26,6 @@
['FileAPI'],
['dom', 'html', 'url'],
idl_array => {
- idl_array.add_untested_idls(
- "[Exposed=(Window,Worker)] interface ArrayBuffer {};"
- );
idl_array.add_objects({
Blob: ['new Blob(["TEST"])'],
File: ['new File(["myFileBits"], "myFileName")'],
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/idlharness.worker.js (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/idlharness.worker.js 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/idlharness.worker.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -9,7 +9,6 @@
['FileAPI'],
['dom', 'html', 'url'],
idl_array => {
- idl_array.add_untested_idls("[Exposed=(Window,Worker)] interface ArrayBuffer {};");
idl_array.add_objects({
Blob: ['new Blob(["TEST"])'],
File: ['new File(["myFileBits"], "myFileName")'],
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/FileReader-multiple-reads.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/FileReader-multiple-reads.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/FileReader-multiple-reads.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -12,7 +12,7 @@
var reader = new FileReader();
reader.readAsText(blob_1)
assert_equals(reader.readyState, FileReader.LOADING, "readyState Must be LOADING")
- assert_throws("InvalidStateError", function () {
+ assert_throws_dom("InvalidStateError", function () {
reader.readAsText(blob_2)
})
}, 'test FileReader InvalidStateError exception for readAsText');
@@ -23,7 +23,7 @@
var reader = new FileReader();
reader.readAsDataURL(blob_1)
assert_equals(reader.readyState, FileReader.LOADING, "readyState Must be LOADING")
- assert_throws("InvalidStateError", function () {
+ assert_throws_dom("InvalidStateError", function () {
reader.readAsDataURL(blob_2)
})
}, 'test FileReader InvalidStateError exception for readAsDataURL');
@@ -34,7 +34,7 @@
var reader = new FileReader();
reader.readAsArrayBuffer(blob_1)
assert_equals(reader.readyState, FileReader.LOADING, "readyState Must be LOADING")
- assert_throws("InvalidStateError", function () {
+ assert_throws_dom("InvalidStateError", function () {
reader.readAsArrayBuffer(blob_2)
})
}, 'test FileReader InvalidStateError exception for readAsArrayBuffer');
@@ -49,7 +49,7 @@
triggered = true;
assert_equals(reader.readyState, FileReader.LOADING,
"readyState must be LOADING")
- assert_throws("InvalidStateError", function () {
+ assert_throws_dom("InvalidStateError", function () {
reader.readAsArrayBuffer(blob_2)
})
});
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,4 @@
+
+FAIL events are dispatched in the correct order for an empty blob assert_equals: Expected load event, but got progress event instead expected "load" but got "progress"
+PASS events are dispatched in the correct order for a non-empty blob
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.js (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.js (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,19 @@
+promise_test(async t => {
+ var reader = new FileReader();
+ var eventWatcher = new EventWatcher(t, reader, ['loadstart', 'progress', 'abort', 'error', 'load', 'loadend']);
+ reader.readAsText(new Blob([]));
+ await eventWatcher.wait_for('loadstart');
+ // No progress event for an empty blob, as no data is loaded.
+ await eventWatcher.wait_for('load');
+ await eventWatcher.wait_for('loadend');
+}, 'events are dispatched in the correct order for an empty blob');
+
+promise_test(async t => {
+ var reader = new FileReader();
+ var eventWatcher = new EventWatcher(t, reader, ['loadstart', 'progress', 'abort', 'error', 'load', 'loadend']);
+ reader.readAsText(new Blob(['a']));
+ await eventWatcher.wait_for('loadstart');
+ await eventWatcher.wait_for('progress');
+ await eventWatcher.wait_for('load');
+ await eventWatcher.wait_for('loadend');
+}, 'events are dispatched in the correct order for a non-empty blob');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.worker-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.worker-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.worker-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,4 @@
+
+FAIL events are dispatched in the correct order for an empty blob assert_equals: Expected load event, but got progress event instead expected "load" but got "progress"
+PASS events are dispatched in the correct order for a non-empty blob
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.worker.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.worker.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.worker.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL-expected.txt (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL-expected.txt 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,3 +1,5 @@
-FAIL FileAPI Test: filereader_readAsDataURL assert_equals: expected 1 but got 2
+FAIL FileReader readyState during readAsDataURL assert_equals: expected 1 but got 2
+PASS readAsDataURL result for Blob with specified MIME type
+FAIL readAsDataURL result for Blob with unspecified MIME type assert_equals: expected "data:application/octet-stream;base64,VEVTVA==" but got "data:;base64,VEVTVA=="
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,39 +1,51 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8">
- <title>FileAPI Test: filereader_readAsDataURL</title>
- <link rel="author" title="Intel" href=""
- <link rel="help" href=""
- <script src=""
- <script src=""
- </head>
- <body>
- <div id="log"></div>
+<!doctype html>
+<meta charset="utf-8">
+<title>FileAPI Test: FileReader.readAsDataURL</title>
+<link rel="author" title="Intel" href=""
+<link rel="help" href=""
+<script src=""
+<script src=""
- <script>
- async_test(function() {
- var blob = new Blob(["TEST"]);
- var reader = new FileReader();
+<script>
+async_test(function(testCase) {
+ var blob = new Blob(["TEST"]);
+ var reader = new FileReader();
- reader._onload_ = this.step_func(function(evt) {
- assert_equals(typeof reader.result, "string", "The result is string");
- assert_equals(reader.result.indexOf("data:"), 0, "The result attribute starts with 'data'");
- assert_true(reader.result.indexOf("base64") > 0, "The result attribute contains 'base64'");
- assert_equals(reader.readyState, reader.DONE);
- this.done();
- });
+ reader._onload_ = this.step_func(function(evt) {
+ assert_equals(reader.readyState, reader.DONE);
+ testCase.done();
+ });
+ reader._onloadstart_ = this.step_func(function(evt) {
+ assert_equals(reader.readyState, reader.LOADING);
+ });
+ reader._onprogress_ = this.step_func(function(evt) {
+ assert_equals(reader.readyState, reader.LOADING);
+ });
- reader._onloadstart_ = this.step_func(function(evt) {
- assert_equals(reader.readyState, reader.LOADING);
- });
+ reader.readAsDataURL(blob);
+}, 'FileReader readyState during readAsDataURL');
- reader._onprogress_ = this.step_func(function(evt) {
- assert_equals(reader.readyState, reader.LOADING);
- });
+async_test(function(testCase) {
+ var blob = new Blob(["TEST"], { type: 'text/plain' });
+ var reader = new FileReader();
- reader.readAsDataURL(blob);
- });
- </script>
- </body>
-</html>
+ reader._onload_ = this.step_func(function() {
+ assert_equals(reader.result, "data:text/plain;base64,VEVTVA==");
+ testCase.done();
+ });
+ reader.readAsDataURL(blob);
+}, 'readAsDataURL result for Blob with specified MIME type');
+
+async_test(function(testCase) {
+ var blob = new Blob(["TEST"]);
+ var reader = new FileReader();
+
+ reader._onload_ = this.step_func(function() {
+ assert_equals(reader.result,
+ "data:application/octet-stream;base64,VEVTVA==");
+ testCase.done();
+ });
+ reader.readAsDataURL(blob);
+}, 'readAsDataURL result for Blob with unspecified MIME type');
+
+</script>
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_result-expected.txt (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_result-expected.txt 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_result-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -2,4 +2,13 @@
PASS readAsText
PASS readAsDataURL
PASS readAsArrayBuffer
+PASS readAsBinaryString
+FAIL result is null during "loadstart" event for readAsText assert_equals: result is null after first read call expected (object) null but got (string) ""
+FAIL result is null during "loadstart" event for readAsDataURL assert_equals: result is null after first read call expected (object) null but got (string) ""
+FAIL result is null during "loadstart" event for readAsArrayBuffer assert_equals: result is null during event expected null but got object "[object ArrayBuffer]"
+FAIL result is null during "loadstart" event for readAsBinaryString assert_equals: result is null after first read call expected (object) null but got (string) ""
+FAIL result is null during "progress" event for readAsText assert_equals: result is null after first read call expected (object) null but got (string) ""
+FAIL result is null during "progress" event for readAsDataURL assert_equals: result is null after first read call expected (object) null but got (string) ""
+FAIL result is null during "progress" event for readAsArrayBuffer assert_equals: result is null during event expected null but got object "[object ArrayBuffer]"
+FAIL result is null during "progress" event for readAsBinaryString assert_equals: result is null after first read call expected (object) null but got (string) ""
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_result.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_result.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_result.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -12,9 +12,10 @@
<div id="log"></div>
<script>
- var blob;
+ var blob, blob2;
setup(function() {
blob = new Blob(["This test the result attribute"]);
+ blob2 = new Blob(["This is a second blob"]);
});
async_test(function() {
@@ -54,6 +55,43 @@
readArrayBuffer.readAsArrayBuffer(blob);
}, "readAsArrayBuffer");
+
+ async_test(function() {
+ var readBinaryString = new FileReader();
+ assert_equals(readBinaryString.result, null);
+
+ readBinaryString._onloadend_ = this.step_func(function(evt) {
+ assert_equals(typeof readBinaryString.result, "string", "The result type is string");
+ assert_equals(readBinaryString.result, "This test the result attribute", "The result is correct");
+ this.done();
+ });
+
+ readBinaryString.readAsBinaryString(blob);
+ }, "readAsBinaryString");
+
+
+ for (let event of ['loadstart', 'progress']) {
+ for (let method of ['readAsText', 'readAsDataURL', 'readAsArrayBuffer', 'readAsBinaryString']) {
+ promise_test(async function(t) {
+ var reader = new FileReader();
+ assert_equals(reader.result, null, 'result is null before read');
+
+ var eventWatcher = new EventWatcher(t, reader,
+ [event, 'loadend']);
+
+ reader[method](blob);
+ assert_equals(reader.result, null, 'result is null after first read call');
+ await eventWatcher.wait_for(event);
+ assert_equals(reader.result, null, 'result is null during event');
+ await eventWatcher.wait_for('loadend');
+ assert_not_equals(reader.result, null);
+ reader[method](blob);
+ assert_equals(reader.result, null, 'result is null after second read call');
+ await eventWatcher.wait_for(event);
+ assert_equals(reader.result, null, 'result is null during second read event');
+ }, 'result is null during "' + event + '" event for ' + method);
+ }
+ }
</script>
</body>
</html>
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/support/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/support/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/support/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
@@ -19,6 +19,7 @@
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/FileReader-multiple-reads.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_abort.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_error.html
+/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_events.any.js
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsArrayBuffer.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsBinaryString.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL.html
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/Blob.js (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/Blob.js 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/Blob.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,3 +1,5 @@
+'use strict'
+
function test_blob(fn, expectations) {
var expected = expectations.expected,
type = expectations.type,
@@ -47,3 +49,22 @@
fr.readAsArrayBuffer(blob);
});
}
+
+// Assert that two TypedArray objects have the same byte values
+self.assert_equals_typed_array = (array1, array2) => {
+ const [view1, view2] = [array1, array2].map((array) => {
+ assert_true(array.buffer instanceof ArrayBuffer,
+ 'Expect input ArrayBuffers to contain field `buffer`');
+ return new DataView(array.buffer, array.byteOffset, array.byteLength);
+ });
+
+ assert_equals(view1.byteLength, view2.byteLength,
+ 'Expect both arrays to be of the same byte length');
+
+ const byteLength = view1.byteLength;
+
+ for (let i = 0; i < byteLength; ++i) {
+ assert_equals(view1.getUint8(i), view2.getUint8(i),
+ `Expect byte at buffer position ${i} to be equal`);
+ }
+}
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/support/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/cross-global-revoke.sub.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/cross-global-revoke.sub.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/cross-global-revoke.sub.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -20,7 +20,7 @@
self.addEventListener('message', t.step_func(e => {
if (e.source !== frame.contentWindow) return;
assert_equals(e.data, 'revoked');
- promise_rejects(t, new TypeError, fetch(url)).then(t.step_func_done());
+ promise_rejects_js(t, TypeError, fetch(url)).then(t.step_func_done());
}));
}, 'It is possible to revoke same-origin blob URLs from different frames.');
@@ -31,7 +31,7 @@
const worker = new Worker('resources/revoke-helper.js');
worker._onmessage_ = t.step_func(e => {
assert_equals(e.data, 'revoked');
- promise_rejects(t, new TypeError, fetch(url)).then(t.step_func_done());
+ promise_rejects_js(t, TypeError, fetch(url)).then(t.step_func_done());
});
worker.postMessage({url: url});
}, 'It is possible to revoke same-origin blob URLs from a different worker global.');
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub-expected.txt (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub-expected.txt 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,9 @@
-Blocked access to external URL http://www.localhost:8800/FileAPI/support/incumbent.sub.html
-CONSOLE MESSAGE: TypeError: frames[0].createBlobURL is not a function. (In 'frames[0].createBlobURL()', 'frames[0].createBlobURL' is undefined)
+CONSOLE MESSAGE: SecurityError: Attempted to use a non-registrable domain.
+Blocked access to external URL http://www1.localhost:8800/FileAPI/support/document-domain-setter.sub.html
+Blocked access to external URL http://www2.localhost:8800/FileAPI/support/document-domain-setter.sub.html
+Blocked access to external URL http://xn--lve-6lad.localhost:8800/FileAPI/support/document-domain-setter.sub.html
+CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
-Harness Error (FAIL), message = TypeError: frames[0].createBlobURL is not a function. (In 'frames[0].createBlobURL()', 'frames[0].createBlobURL' is undefined)
+FAIL Blob URL serialization (specifically the origin) in multi-global situations SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
-
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -9,10 +9,11 @@
<!-- this page is the entry global -->
-<iframe src=""
+<iframe src=""
<script>
"use strict";
+setup({ single_test: true });
document.domain = "{{host}}";
window._onload_ = () => {
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/resources/revoke-helper.js (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/resources/revoke-helper.js 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/resources/revoke-helper.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,4 +1,9 @@
self.addEventListener('message', e => {
URL.revokeObjectURL(e.data.url);
+ // Registering a new object URL will make absolutely sure that the revocation
+ // has propagated. Without this at least in chrome it is possible for the
+ // below postMessage to arrive at its destination before the revocation has
+ // been fully processed.
+ URL.createObjectURL(new Blob([]));
self.postMessage('revoked');
});
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/resources/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/resources/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/resources/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe-expected.txt (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe-expected.txt 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,23 +1,24 @@
+CONSOLE MESSAGE: Not allowed to load local resource: blob:null/ed58c75f-a210-4d63-a072-71a5f08c71ff#block2
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/d1801cd6-cf38-4d13-a661-fbd8810e7007 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/5223372d-9f9d-4b09-9e55-10a2c173d76c due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/0d6efa45-4589-4ae0-b3fb-5f51b004946e#fragment due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/205bb96f-a7cb-4ebd-a48a-24895169605e#fragment due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/c4553d08-4b95-4306-b37b-360bfe282412 due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/e7e2723e-0ecd-42d0-b2f8-3a49e34fcefb due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/8f66f90e-8ca2-4a13-bb25-c3f8a2443688?querystring due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/e9403383-2a1f-4928-91b2-9f24dfb203a1?querystring due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/81f47b74-8c88-4abb-a2fa-68e0469512ed/path due to access control checks.
+CONSOLE MESSAGE: XMLHttpRequest cannot load blob:null/53d30f55-04a7-40c1-a84a-31da7fb8eb48/path due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: Fetch API cannot load blob:null/23463417-46d8-432d-9e4a-decaa7db24a0#fragment due to access control checks.
+CONSOLE MESSAGE: Fetch API cannot load blob:null/d4e47cf5-1859-4d6d-8690-e9366cc0ef38#fragment due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: Fetch API cannot load blob:null/4750b3fc-6988-4dc1-a5b7-6e9fec56083d due to access control checks.
+CONSOLE MESSAGE: Fetch API cannot load blob:null/75663ec2-d863-4fa9-b96b-888576b81404 due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: Fetch API cannot load blob:null/97c5ff0a-bce2-4055-b299-72fa555e417c?querystring due to access control checks.
+CONSOLE MESSAGE: Fetch API cannot load blob:null/40f1d6f1-36cc-47a8-a03c-ec03f1f3c9cb?querystring due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: Fetch API cannot load blob:null/79df7f44-df14-49b2-9211-63492d09951c/path due to access control checks.
+CONSOLE MESSAGE: Fetch API cannot load blob:null/a2a9a99e-380f-47fa-907f-132e4a9f2116/path due to access control checks.
CONSOLE MESSAGE: Cross origin requests are only supported for HTTP.
-CONSOLE MESSAGE: Fetch API cannot load blob:null/e65cf001-c90c-48b1-b0a3-1c0f211e6d37 due to access control checks.
+CONSOLE MESSAGE: Fetch API cannot load blob:null/ebacc727-d8f7-44d9-b7ca-850ec3cf3c18 due to access control checks.
PASS Generated Blob URLs are unique
PASS Blob URL starts with "blob:"
@@ -25,6 +26,11 @@
PASS Origin of Blob URL matches our origin
PASS Blob URL parses correctly
PASS Origin of Blob URL matches our origin for Files
+PASS Blob URLs can be used in <script> tags
+FAIL Blob URLs can be used in iframes, and are treated same origin Sandbox access violation: Blocked a frame at "null" from accessing a cross-origin frame. Both frames are sandboxed and lack the "allow-same-origin" flag.
+FAIL Blob URL fragment is implemented. null is not an object (evaluating 'frame.contentWindow._onscroll_ = t.step_func_done(() => {
+ assert_equals(frame.contentWindow.scrollY, 5000);
+ })')
PASS Blob URLs can be used in XHR
FAIL XHR with a fragment should succeed promise_test: Unhandled rejection with value: "Got unexpected error event"
PASS XHR of a revoked URL should fail
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,6 +1,7 @@
<!doctype html>
<meta charset="utf-8">
<title>FileAPI Test: Verify behavior of Blob URL in unique origins</title>
+<meta name="timeout" content="long">
<script src=""
<script src=""
@@ -11,9 +12,9 @@
const iframe_scripts = [
'resources/fetch-tests.js',
'url-format.any.js',
+ 'url-in-tags.window.js',
'url-with-xhr.any.js',
'url-with-fetch.any.js',
- 'url-with-tags.window.js',
];
let html = '<!doctype html>\n<meta charset="utf-8">\n<body>\n';
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-format.any.js (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-format.any.js 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-format.any.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,3 +1,4 @@
+// META: timeout=long
const blob = new Blob(['test']);
const file = new File(['test'], 'name');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,10 @@
+
+Harness Error (TIMEOUT), message = null
+
+PASS Fetching a blob URL immediately before revoking it works in an iframe.
+TIMEOUT Fetching a blob URL immediately before revoking it works in an iframe navigation. Test timed out
+PASS Opening a blob URL in a new window immediately before revoking it works.
+FAIL Opening a blob URL in a noopener about:blank window immediately before revoking it works. Can't find variable: BroadcastChannel
+PASS Fetching a blob URL immediately before revoking it works in <script> tags.
+FAIL Opening a blob URL in a new window by clicking an <a> tag works immediately before revoking the URL. Can't find variable: BroadcastChannel
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window.js (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window.js 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags-revoke.window.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,3 +1,4 @@
+// META: timeout=long
async_test(t => {
const run_result = 'test_frame_OK';
const blob_contents = '<!doctype html>\n<meta charset="utf-8">\n' +
@@ -97,3 +98,18 @@
document.body.appendChild(e);
URL.revokeObjectURL(url);
}, 'Fetching a blob URL immediately before revoking it works in <script> tags.');
+
+async_test(t => {
+ const channel_name = 'a-click-test';
+ const blob = new Blob([window_contents_for_channel(channel_name)], {type: 'text/html'});
+ receive_message_on_channel(t, channel_name).then(t.step_func_done(t => {
+ assert_equals(t, 'foobar');
+ }));
+ const url = ""
+ const anchor = document.createElement('a');
+ anchor.href = ""
+ anchor.target = '_blank';
+ document.body.appendChild(anchor);
+ anchor.click();
+ URL.revokeObjectURL(url);
+}, 'Opening a blob URL in a new window by clicking an <a> tag works immediately before revoking the URL.');
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags.window-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags.window-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,7 @@
+
+Harness Error (TIMEOUT), message = null
+
+PASS Blob URLs can be used in <script> tags
+PASS Blob URLs can be used in iframes, and are treated same origin
+TIMEOUT Blob URL fragment is implemented. Test timed out
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags.window.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-in-tags.window.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-lifetime.html (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-lifetime.html 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-lifetime.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -20,7 +20,7 @@
}).then(response => response.text()).then(text => {
assert_equals(text, blob_contents);
return new Promise(resolve => t.step_timeout(resolve, 100));
- }).then(() => promise_rejects(t, new TypeError, fetch(url)));
+ }).then(() => promise_rejects_js(t, TypeError, fetch(url)));
}, 'Terminating worker revokes its URLs');
promise_test(t => {
@@ -51,6 +51,6 @@
}).then(response => response.text()).then(text => {
assert_equals(text, blob_contents);
return new Promise(resolve => t.step_timeout(resolve, 100));
- }).then(() => promise_rejects(t, new TypeError, fetch(url)));
+ }).then(() => promise_rejects_js(t, TypeError, fetch(url)));
}, 'Removing an iframe revokes its URLs');
</script>
\ No newline at end of file
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-reload.window-expected.txt (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-reload.window-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-reload.window-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,6 @@
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Reloading a blob URL succeeds. Test timed out
+TIMEOUT Reloading a blob URL succeeds even if the URL was revoked. Test timed out
+
Added: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-reload.window.html (0 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-reload.window.html (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-reload.window.html 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.js (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.js 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url-with-fetch.any.js 2020-06-15 21:15:20 UTC (rev 263059)
@@ -5,7 +5,7 @@
}
function fetch_should_fail(test, url, method = 'GET') {
- return promise_rejects(test, new TypeError, fetch(url, {method: method}));
+ return promise_rejects_js(test, TypeError, fetch(url, {method: method}));
}
fetch_tests('fetch', fetch_should_succeed, fetch_should_fail);
Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url_xmlhttprequest-expected.txt (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url_xmlhttprequest-expected.txt 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/url_xmlhttprequest-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,3 +0,0 @@
-
-PASS FileAPI Test: Creating Blob URL via XMLHttpRequest
-
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/url/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/w3c-import.log (263058 => 263059)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/w3c-import.log 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/w3c-import.log 2020-06-15 21:15:20 UTC (rev 263059)
@@ -1,7 +1,7 @@
The tests in this directory were imported from the W3C repository.
Do NOT modify these tests directly in WebKit.
Instead, create a pull request on the WPT github:
- https://github.com/w3c/web-platform-tests
+ https://github.com/web-platform-tests/wpt
Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
@@ -15,7 +15,7 @@
------------------------------------------------------------------------
List of files:
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/FileReaderSync.worker.js
-/LayoutTests/imported/w3c/web-platform-tests/FileAPI/OWNERS
+/LayoutTests/imported/w3c/web-platform-tests/FileAPI/META.yml
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/fileReader.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/historical.https.html
/LayoutTests/imported/w3c/web-platform-tests/FileAPI/idlharness.html
Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub-expected.txt (0 => 263059)
--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/url/multi-global-origin-serialization.sub-expected.txt 2020-06-15 21:15:20 UTC (rev 263059)
@@ -0,0 +1,9 @@
+Blocked access to external URL http://www1.localhost:8800/FileAPI/support/document-domain-setter.sub.html
+Blocked access to external URL http://www2.localhost:8800/FileAPI/support/document-domain-setter.sub.html
+Blocked access to external URL http://xn--lve-6lad.localhost:8800/FileAPI/support/document-domain-setter.sub.html
+CONSOLE MESSAGE: SecurityError: Attempted to use a non-registrable domain.
+CONSOLE MESSAGE: SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
+
+
+FAIL Blob URL serialization (specifically the origin) in multi-global situations SecurityError: Blocked a frame with origin "http://localhost:8800" from accessing a cross-origin frame. Protocols, domains, and ports must match.
+
Modified: trunk/LayoutTests/tests-options.json (263058 => 263059)
--- trunk/LayoutTests/tests-options.json 2020-06-15 21:14:02 UTC (rev 263058)
+++ trunk/LayoutTests/tests-options.json 2020-06-15 21:15:20 UTC (rev 263059)
@@ -146,6 +146,9 @@
"imported/w3c/web-animations/timing-model/timelines/update-and-send-events.html": [
"slow"
],
+ "imported/w3c/web-platform-tests/FileAPI/url/sandboxed-iframe.html": [
+ "slow"
+ ],
"imported/w3c/web-platform-tests/IndexedDB/idb-binary-key-roundtrip.htm": [
"slow"
],