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

Unified Diff: LayoutTests/fast/workers/resources/worker-multi-port.js

Issue 1025203002: Have postMessage()s throw TypeError on failed arity checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tidy up incorrect postMessage() usage Created 5 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
Index: LayoutTests/fast/workers/resources/worker-multi-port.js
diff --git a/LayoutTests/fast/workers/resources/worker-multi-port.js b/LayoutTests/fast/workers/resources/worker-multi-port.js
index 2018f97012d07da044a65dbeae45cfd95b0fc016..1847182ba0d921e3d336ca99ad293c5bad0b5c8a 100644
--- a/LayoutTests/fast/workers/resources/worker-multi-port.js
+++ b/LayoutTests/fast/workers/resources/worker-multi-port.js
@@ -11,11 +11,13 @@ var channel3 = new MessageChannel();
var channel4 = new MessageChannel();
var worker = new Worker("resources/worker-thread-multi-port.js");
+worker.postMessage("noargs");
worker.postMessage("noport");
worker.postMessage("zero ports", []);
worker.postMessage("two ports", [channel2.port1, channel2.port2]);
// Now test various failure cases
+shouldThrow("worker.postMessage()");
shouldThrow('worker.postMessage("null port", [channel3.port1, null, channel3.port2])');
shouldThrow('worker.postMessage("notAPort", [channel3.port1, {}, channel3.port2])');
// Should be OK to send channel3.port1/2 (should not have been disentangled by the previous failed calls).
@@ -36,4 +38,3 @@ worker.onmessage = function(event) {
else
testFailed("Unexpected result: " + event.data);
}
-

Powered by Google App Engine
This is Rietveld 408576698