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

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: remove a comment 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') | third_party/WebKit/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: 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..ee07a6e0a54c1c6c8cee14e79d7f8146ff7793ae 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
@@ -25,6 +25,18 @@ function onmessage(evt) {
window.addEventListener('message', onmessage, false);
+function convertDetached(obj) {
+ if (obj instanceof Int8Array && obj.byteLength === 0)
+ return "[detached TypedArray]";
+ return obj;
+}
+
+function convertArrayDetached(obj) {
+ if (obj instanceof Array)
+ return obj.map(convertDetached)
+ return obj;
+}
+
function tryPostMessageFunction(postMessageFunction, first, second, third, shouldFail) {
var pass, reason;
try {
@@ -36,9 +48,9 @@ function tryPostMessageFunction(postMessageFunction, first, second, third, shoul
reason = ": threw exception " + e;
}
if (pass)
- testPassed("Posting message ('" + first + "', " + third + ")" + reason);
+ testPassed("Posting message ('" + convertDetached(first) + "', " + convertArrayDetached(third) + ")" + reason);
else
- testFailed("Posting message ('" + first + "', " + third + ")" + reason);
+ testFailed("Posting message ('" + convertDetached(first) + "', " + convertArrayDetached(third) + ")" + reason);
}
function tryPostMessage(first, second, third, shouldFail) {
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698