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

Unified Diff: LayoutTests/fast/dom/Window/window-postmessage-args.html

Issue 1033443002: Revert of Have postMessage()s throw TypeError on failed arity checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Window/window-postmessage-args.html
diff --git a/LayoutTests/fast/dom/Window/window-postmessage-args.html b/LayoutTests/fast/dom/Window/window-postmessage-args.html
index 97155c3d15785043cd5a979c36a1e07665a660eb..805c582fa98ef55c350390dbe2b96696ae1fb37f 100644
--- a/LayoutTests/fast/dom/Window/window-postmessage-args.html
+++ b/LayoutTests/fast/dom/Window/window-postmessage-args.html
@@ -1,26 +1,24 @@
<html>
-<head>
-<script src="../../../resources/js-test.js"></script>
-</head>
+<head></head>
<body>
+<div id="description"></div>
+<div id="console"></div>
<script>
-description("Test window.postMessage() argument handling.");
-
-self.jsTestIsAsync = true;
-
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
+var console = document.getElementById("console");
+
function onmessage(evt) {
if (evt.ports)
- debug("Received message '" + evt.data + "' with " + evt.ports.length + " ports.");
+ console.innerHTML += "Received message '" + evt.data + "' with " + evt.ports.length + " ports.<br>";
else
- debug("Received message '" + evt.data);
+ console.innerHTML += "Received message '" + evt.data + "'<br>";
- if (evt.data == 'done')
- finishJSTest();
+ if (evt.data == 'done' && window.testRunner)
+ testRunner.notifyDone();
}
window.addEventListener('message', onmessage, false);
@@ -35,10 +33,7 @@
pass = shouldFail;
reason = ": threw exception " + e;
}
- if (pass)
- testPassed("Posting message ('" + first + "', " + third + ")" + reason);
- else
- testFailed("Posting message ('" + first + "', " + third + ")" + reason);
+ console.innerHTML += (pass ? "PASS" : "FAIL") + ": Posting message ('" + first + "', " + third + ")" + reason + "<br>";
}
function tryPostMessage(first, second, third, shouldFail) {
@@ -74,16 +69,19 @@
var arrayBuffer = new ArrayBuffer(30);
var int8View = new Int8Array(arrayBuffer, 2, 10);
tryPostMessageFunction(window.postMessage, arrayBuffer, '*', [arrayBuffer]);
-if (!(arrayBuffer.byteLength === 0))
- testFailed("arrayBuffer not neutered; byteLength = " + arrayBuffer.byteLength);
-else
- testPassed("arrayBuffer neutered");
+if (!(arrayBuffer.byteLength === 0)) {
+ console.innerHTML += "FAIL: arrayBuffer not neutered; byteLength = " + arrayBuffer.byteLength + "<br>";
+}
+else {
+ console.innerHTML += "PASS: arrayBuffer neutered<br>";
+}
-if (!(int8View.length == 0))
- testFailed("view was not neutered; length = " + int8View.length);
-else
- testPassed("view neutered");
-
+if (!(int8View.length == 0)) {
+ console.innerHTML += "FAIL: view was not neutered; length = " + int8View.length + "<br>";
+}
+else {
+ console.innerHTML += "PASS: view neutered<br>"
+}
tryPostMessageFunction(window.postMessage, arrayBuffer, '*', [], true);
tryPostMessageFunction(window.postMessage, 'data', '*', [arrayBuffer], true);
@@ -94,9 +92,6 @@
tryPostMessageFunction(window.postMessage, 'data', '*', [1,,2], true);
tryPostMessageFunction(window.postMessage, 'data', '*', [null, window.postMessage], true);
-shouldThrow("window.postMessage()");
-shouldThrow("window.postMessage('a')");
-
tryPostMessageFunction(window.postMessage, 'done', '*');
</script>
</body>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698