mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
re-structure blob, structured serialization
This commit is contained in:
parent
7aa68c8fe7
commit
6e8a85482c
31 changed files with 997 additions and 489 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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": [
|
||||
|
|
|
@ -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>
|
|
@ -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");
|
|
@ -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");
|
Loading…
Add table
Add a link
Reference in a new issue