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 1022283002: Throw TypeError if value conversion to transferable fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add more tests for TypeError throwing 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 bf05fdbd0dcc47a8ec9314181119afa562f4806b..805c582fa98ef55c350390dbe2b96696ae1fb37f 100644
--- a/LayoutTests/fast/dom/Window/window-postmessage-args.html
+++ b/LayoutTests/fast/dom/Window/window-postmessage-args.html
@@ -24,15 +24,16 @@ function onmessage(evt) {
window.addEventListener('message', onmessage, false);
function tryPostMessageFunction(postMessageFunction, first, second, third, shouldFail) {
- try {
- if (!third)
- postMessageFunction(first, second);
- else
- postMessageFunction(first, second, third);
- console.innerHTML += (shouldFail ? "FAIL" : "PASS") + ": Posting message ('" + first + "', " + third + ") did not throw an exception<br>";
- } catch (e) {
- console.innerHTML += (shouldFail ? "PASS" : "FAIL") + ": Posting message ('" + first + "', " + third + "): threw exception " + e + "<br>";
- }
+ var pass, reason;
+ try {
+ postMessageFunction(first, second, third);
+ pass = !shouldFail;
+ reason = " did not throw an exception";
+ } catch (e) {
+ pass = shouldFail;
+ reason = ": threw exception " + e;
+ }
+ console.innerHTML += (pass ? "PASS" : "FAIL") + ": Posting message ('" + first + "', " + third + ")" + reason + "<br>";
}
function tryPostMessage(first, second, third, shouldFail) {
@@ -87,6 +88,10 @@ tryPostMessageFunction(window.postMessage, 'data', '*', [arrayBuffer], true);
tryPostMessageFunction(window.postMessage, int8View, '*', [], true);
tryPostMessageFunction(window.postMessage, 'data', '*', [int8View], true);
+tryPostMessageFunction(window.postMessage, 'data', '*', {length:1}, true);
+tryPostMessageFunction(window.postMessage, 'data', '*', [1,,2], true);
+tryPostMessageFunction(window.postMessage, 'data', '*', [null, window.postMessage], true);
+
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