Chromium Code Reviews| 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); |
|
Mike West
2014/03/07 13:28:13
This isn't pretty. I'm not a fan of test code that
sof
2014/03/07 13:34:32
That's the test setup in this file.
|
| + |
| function thunk(s) { |
| return "(function() {" + s + "})()"; |
| } |