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..18778967b1b0d71499c14af3c17049d62ec9a4d5 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,19 @@ function onmessage(evt) { |
window.addEventListener('message', onmessage, false); |
+function convertDetached(obj) { |
+ // Represent detached TypedArrays as "" |
adamk
2017/04/11 15:13:33
This comment doesn't match what the code does.
Choongwoo Han
2017/04/11 15:16:15
Done.
|
+ 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 +49,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) { |