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

Unified Diff: LayoutTests/fast/events/resources/message-port-multi.js

Issue 19765010: postMessage() should throw a DataCloneError on invalid transferables (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
Index: LayoutTests/fast/events/resources/message-port-multi.js
diff --git a/LayoutTests/fast/events/resources/message-port-multi.js b/LayoutTests/fast/events/resources/message-port-multi.js
index 0b0a69cd62445d26bb46f671c87d4ab4d8504b50..7a5109eb67b77c97f1aef7cc1bcd676e3d7f735a 100644
--- a/LayoutTests/fast/events/resources/message-port-multi.js
+++ b/LayoutTests/fast/events/resources/message-port-multi.js
@@ -15,22 +15,22 @@ channel.port1.postMessage("zero ports", []);
channel.port1.postMessage("two ports", [channel2.port1, channel2.port2]);
// Now test various failure cases
-shouldThrow('channel.port1.postMessage("same port", [channel.port1])');
-shouldThrow('channel.port1.postMessage("entangled port", [channel.port2])');
-shouldThrow('channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2])');
-shouldThrow('channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2])');
-shouldThrow('channel.port1.postMessage("duplicate port", [channel3.port1, channel3.port1])');
+shouldThrow('channel.port1.postMessage("same port", [channel.port1])', "'DataCloneError: An object could not be cloned.'");
+shouldThrow('channel.port1.postMessage("entangled port", [channel.port2])', "'DataCloneError: An object could not be cloned.'");
+shouldThrow('channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2])', "'DataCloneError: An object could not be cloned.'");
+shouldThrow('channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2])', "'DataCloneError: An object could not be cloned.'");
+shouldThrow('channel.port1.postMessage("duplicate port", [channel3.port1, channel3.port1])', "'DataCloneError: An object could not be cloned.'");
// Should be OK to send channel3.port1 (should not have been disentangled by the previous failed calls).
channel.port1.postMessage("entangled ports", [channel3.port1, channel3.port2]);
-shouldThrow('channel.port1.postMessage("notAnArray", channel3.port1)')
-shouldThrow('channel.port1.postMessage("notASequence", [{length: 3}])');
+shouldThrow('channel.port1.postMessage("notAnArray", channel3.port1)', "'TypeError: Type error'")
+shouldThrow('channel.port1.postMessage("notASequence", [{length: 3}])', "'DataCloneError: An object could not be cloned.'");
// Should not crash (we should figure out that the array contains undefined
// entries).
var largePortArray = [];
largePortArray[1234567890] = channel4.port1;
-shouldThrow('channel.port1.postMessage("largeSequence", largePortArray)');
+shouldThrow('channel.port1.postMessage("largeSequence", largePortArray)', "'DataCloneError: An object could not be cloned.'");
channel.port1.postMessage("done");

Powered by Google App Engine
This is Rietveld 408576698