diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2019-09-01 03:18:42 +0800 |
---|---|---|
committer | Gregory Terzian <gterzian@users.noreply.github.com> | 2019-12-11 22:46:50 +0800 |
commit | 6e8a85482c2068d4dbccb992954271f725570f91 (patch) | |
tree | b30f6d82a018df0b196fa4d47d3b6667d708313e /tests | |
parent | 7aa68c8fe7ca0865a7323ab1e5b9526efa588ca2 (diff) | |
download | servo-6e8a85482c2068d4dbccb992954271f725570f91.tar.gz servo-6e8a85482c2068d4dbccb992954271f725570f91.zip |
re-structure blob, structured serialization
Diffstat (limited to 'tests')
6 files changed, 67 insertions, 39 deletions
diff --git a/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini b/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini index cd3e2dfa305..a9e46713244 100644 --- a/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini +++ b/tests/wpt/metadata/FileAPI/url/url-in-tags-revoke.window.js.ini @@ -15,3 +15,6 @@ [Opening a blob URL in a new window by clicking an <a> tag works immediately before revoking the URL.] expected: FAIL + [Fetching a blob URL immediately before revoking it works in <script> tags.] + expected: TIMEOUT + diff --git a/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini b/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini index 0bf3b469372..f28a19f1250 100644 --- a/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini +++ b/tests/wpt/metadata/FileAPI/url/url-with-fetch.any.js.ini @@ -2,6 +2,9 @@ [Revoke blob URL after creating Request, will fetch] expected: FAIL + [Revoke blob URL after calling fetch, fetch should succeed] + expected: FAIL + [url-with-fetch.any.html] [Revoke blob URL after creating Request, will fetch] diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 9520740e3b0..1b0be71b68a 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -358970,9 +358970,15 @@ {} ] ], - "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html": [ + "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.window.js": [ [ - "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html", + "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.window.html", + {} + ] + ], + "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob_array.window.js": [ + [ + "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob_array.window.html", {} ] ], @@ -653472,8 +653478,12 @@ "995edac8da9d95ac6f151863b5cd48994941a347", "testharness" ], - "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html": [ - "6b1abf5ef8d30c2494effac489db79732d0c12d4", + "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.window.js": [ + "490e78165de820d31f25cd3f09416a8cbf1b1c66", + "testharness" + ], + "html/infrastructure/safe-passing-of-structured-data/structured_clone_blob_array.window.js": [ + "b976d5b212652bf763b4a6039a70c26758c84ccf", "testharness" ], "html/infrastructure/safe-passing-of-structured-data/structuredclone_0.html": [ diff --git a/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html b/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html deleted file mode 100644 index 6b1abf5ef8d..00000000000 --- a/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.html +++ /dev/null @@ -1,35 +0,0 @@ -<!doctype html> -<html> -<head> -<meta charset="utf-8"> -<title>Safe passing of structured data - Blob</title> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -</head> -<body> -<script> -async_test(function(t) { - var blob = new Blob(['<a id="a"><b id="b">hey!</b></a>'], {type:"text/plain"}); - window.addEventListener("message", this.step_func(function(msg) { - assert_true(msg.data instanceof Blob); - assert_equals(msg.data.size, blob.size); - assert_equals(msg.data.type, blob.type); - var cloned_content, original_content; - var reader = new FileReader(); - reader.addEventListener("loadend", this.step_func(function() { - original_content = reader.result; - var reader2 = new FileReader(); - reader2.addEventListener("loadend", this.step_func_done(function() { - cloned_content = reader2.result; - assert_equals(typeof cloned_content, typeof original_content); - assert_equals(cloned_content, original_content); - })); - reader2.readAsText(msg.data); - })); - reader.readAsText(blob); - }), false); - window.postMessage(blob, '*'); -}, "Cloning a Blob into the same realm"); -</script> -</body> -</html> diff --git a/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.window.js b/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.window.js new file mode 100644 index 00000000000..490e78165de --- /dev/null +++ b/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob.window.js @@ -0,0 +1,22 @@ +async_test(function(t) { + var blob = new Blob(['<a id="a"><b id="b">hey!</b></a>'], {type:"text/plain"}); + onmessage = t.step_func(function(msg) { + assert_true(msg.data instanceof Blob); + assert_equals(msg.data.size, blob.size); + assert_equals(msg.data.type, blob.type); + var cloned_content, original_content; + var reader = new FileReader(); + reader.addEventListener("loadend", t.step_func(function() { + original_content = reader.result; + var reader2 = new FileReader(); + reader2.addEventListener("loadend", t.step_func_done(function() { + cloned_content = reader2.result; + assert_equals(typeof cloned_content, typeof original_content); + assert_equals(cloned_content, original_content); + })); + reader2.readAsText(msg.data); + })); + reader.readAsText(blob); + }); + postMessage(blob, '*'); +}, "Cloning a blob into the same realm"); diff --git a/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob_array.window.js b/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob_array.window.js new file mode 100644 index 00000000000..b976d5b2126 --- /dev/null +++ b/tests/wpt/web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured_clone_blob_array.window.js @@ -0,0 +1,25 @@ +async_test(function(t) { + var blob = new Blob(['<a id="a"><b id="b">hey!</b></a>'], {type:"text/plain"}); + var another_blob = new Blob(['<a id="a"><b id="b">hey!</b></a>'], {type:"text/plain"}); + onmessage = t.step_func(function(msg) { + assert_true(msg.data instanceof Array); + assert_equals(msg.data.length, 2); + msg.data.forEach((function(blob, index) { + assert_true(blob instanceof Blob); + var cloned_content, original_content; + var reader = new FileReader(); + reader.addEventListener("loadend", t.step_func(function() { + original_content = reader.result; + var reader2 = new FileReader(); + reader2.addEventListener("loadend", t.step_func_done(function() { + cloned_content = reader2.result; + assert_equals(typeof cloned_content, typeof original_content); + assert_equals(cloned_content, original_content); + })); + reader2.readAsText(msg.data[index]); + })); + reader.readAsText(blob); + })); + }); + postMessage([blob, another_blob], '*'); +}, "Cloning an array of blobs into the same realm"); |