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

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

Issue 2810543002: [tests] Convert a detached typed array to a null string (Closed)
Patch Set: Created 3 years, 8 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args.html b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args.html
index 7f2eeb862d6f04d195080454b4b5b4c2425f5aeb..ec936fb5008f3e96e82d3cb3c3666c1939d5e553 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args.html
@@ -35,14 +35,21 @@ function tryPostMessageFunction(postMessageFunction, first, second, third, shoul
pass = shouldFail;
reason = ": threw exception " + e;
}
+ // we cannot convert detached typed arrays into strings, thus
+ // manually convert detached typed arrays into a null string.
+ if (first instanceof Int8Array && first.byteLength === 0)
+ first = "";
+ for (var i = 0; third && i < third.length; i++) {
+ if (third[i] instanceof Int8Array && third[i].byteLength === 0)
+ third[i] = "";
+ }
Dan Ehrenberg 2017/04/11 10:20:22 Nit: this code could be slightly cleaned up, and c
Choongwoo Han 2017/04/11 12:48:23 Done.
if (pass)
testPassed("Posting message ('" + first + "', " + third + ")" + reason);
else
testFailed("Posting message ('" + first + "', " + third + ")" + reason);
}
-function tryPostMessage(first, second, third, shouldFail) {
- tryPostMessageFunction(window.postMessage, first, second, third, shouldFail);
+function tryPostMessage(first, second, third, shouldFail) { tryPostMessageFunction(window.postMessage, first, second, third, shouldFail);
Dan Ehrenberg 2017/04/11 10:20:22 Nit: Undo this whitespace change.
Choongwoo Han 2017/04/11 12:48:23 Done.
}
document.getElementById("description").innerHTML = "Test that the second argument of window.postMessage is ignored or triggers an error if it is not a message port. You should see PASS message '1' through '7', followed by 'done', with messages 4-7 received below.<br><br>";
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698