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

Unified Diff: LayoutTests/fast/workers/resources/worker-thread-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-thread-multi-port.js
diff --git a/LayoutTests/fast/workers/resources/worker-thread-multi-port.js b/LayoutTests/fast/workers/resources/worker-thread-multi-port.js
index 6bed2ff502b0a97ed4b9302319b15780dd1434db..27424cc642c69052ce738aef00bbd78a08572ba9 100644
--- a/LayoutTests/fast/workers/resources/worker-thread-multi-port.js
+++ b/LayoutTests/fast/workers/resources/worker-thread-multi-port.js
@@ -26,6 +26,13 @@ onmessage = function(event) {
} else if (event.data == "done") {
postMessage("done");
event.ports[0].postMessage("done");
+ } else if (event.data == "noargs") {
+ try {
+ postMessage();
+ testFailed("postMessage() did not throw");
+ } catch (e) {
+ testPassed("postMessage() threw exception: " + e);
+ }
} else
testFailed("Received unexpected message: " + event.data);
};
« no previous file with comments | « LayoutTests/fast/workers/resources/worker-multi-port.js ('k') | LayoutTests/fast/workers/worker-multi-port-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698