Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Unified Diff: LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js

Issue 189623014: Throw DataCloneError on cloning closed Blobs/Files. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Error message tweak Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js
diff --git a/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js b/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js
index 2ee8ca14ce6b9a096e2f6059b928b557cf5ef500..645a85ce28fbcf400450166e29d81c3a7d9fa43a 100644
--- a/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js
+++ b/LayoutTests/fast/dom/Window/script-tests/postmessage-clone.js
@@ -75,6 +75,18 @@ tryPostMessage('mutatedImageData.data', false, imageData.data)
for (var i = 0; i < imageData.data.length * 4; i++)
mutatedImageData.data[i] = 0;
+// Test close() special case for Blob (and File.)
+
+var blob = new Blob(["Hello"]);
+var blobSize = blob.size;
+tryPostMessage('blob', false, "evalThunk", function(v) { doPassFail(v.size === blobSize, "Cloned Blob size equal to the original size."); });
+tryPostMessage('blob.close(); blob', true, null, DOMException.DATA_CLONE_ERR);
+
+var constructedFile = new File(["Hello"], "test");
+var fileSize = constructedFile.size;
+tryPostMessage('constructedFile', false, "evalThunk", function(v) { doPassFail(v.size === fileSize, "Cloned File size equal to the original size."); });
+tryPostMessage('constructedFile.close(); constructedFile', true, null, DOMException.DATA_CLONE_ERR);
+
function thunk(s) {
return "(function() {" + s + "})()";
}
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/window-postmessage-clone-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698