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

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

Issue 30673002: More informative error messages for non-Transferables. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More informative error messages for non-Transferables. Created 7 years, 2 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head></head> 2 <head></head>
3 <body> 3 <body>
4 <div id="description"></div> 4 <div id="description"></div>
5 <div id="console"></div> 5 <div id="console"></div>
6 <script> 6 <script>
7 if (window.testRunner) { 7 if (window.testRunner) {
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 testRunner.waitUntilDone(); 9 testRunner.waitUntilDone();
10 } 10 }
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 } 36 }
37 37
38 function tryPostMessage(first, second, third, shouldFail) { 38 function tryPostMessage(first, second, third, shouldFail) {
39 tryPostMessageFunction(window.postMessage, first, second, third, shouldFail) ; 39 tryPostMessageFunction(window.postMessage, first, second, third, shouldFail) ;
40 } 40 }
41 41
42 document.getElementById("description").innerHTML = "Test that the second argumen t of window.postMessage is ignored or triggers an error if it is not a message p ort. You should see PASS message '1' through '7', followed by 'done', with messa ges 4-7 received below.<br><br>"; 42 document.getElementById("description").innerHTML = "Test that the second argumen t of window.postMessage is ignored or triggers an error if it is not a message p ort. You should see PASS message '1' through '7', followed by 'done', with messa ges 4-7 received below.<br><br>";
43 43
44 tryPostMessage('1', '*', 1, true); 44 tryPostMessage('1', '*', 1, true);
45 tryPostMessage('2', '*', 'c', true); 45 tryPostMessage('2', '*', 'c', true); // Legacy overload resolution will consider 3rd argument to be the (string) origin.
46 tryPostMessage('3', '*', { x: 1 }, true); 46 tryPostMessage('3', '*', { x: 1 }, true);
47 tryPostMessage('3a', { x: 1 }, '*', true); // Legacy argument order.
47 tryPostMessage('4', '*', window); // Passes because window has a "length" attri bute of value '0', so it looks like an array 48 tryPostMessage('4', '*', window); // Passes because window has a "length" attri bute of value '0', so it looks like an array
48 tryPostMessage('4a', window, '*'); // Legacy argument order. 49 tryPostMessage('4a', window, '*'); // Legacy argument order.
49 tryPostMessage('5', '*', null); 50 tryPostMessage('5', '*', null);
50 tryPostMessage('6', '*', void 0); 51 tryPostMessage('6', '*', void 0);
51 var channel1 = new MessageChannel; 52 var channel1 = new MessageChannel;
52 tryPostMessageFunction(window.postMessage, '7', '*', [channel1.port1, channel1.p ort2]); 53 tryPostMessageFunction(window.postMessage, '7', '*', [channel1.port1, channel1.p ort2]);
53 var channel1a = new MessageChannel; 54 var channel1a = new MessageChannel;
54 tryPostMessageFunction(window.postMessage, '7a', [channel1a.port1, channel1a.por t2], '*'); 55 tryPostMessageFunction(window.postMessage, '7a', [channel1a.port1, channel1a.por t2], '*');
55 var channel2 = new MessageChannel; 56 var channel2 = new MessageChannel;
56 tryPostMessageFunction(window.postMessage, '7', '*', [channel2.port1, channel2.p ort2]); 57 tryPostMessageFunction(window.postMessage, '7', '*', [channel2.port1, channel2.p ort2]);
(...skipping 20 matching lines...) Expand all
77 } 78 }
78 else { 79 else {
79 console.innerHTML += "PASS: view neutered<br>" 80 console.innerHTML += "PASS: view neutered<br>"
80 } 81 }
81 82
82 83
83 tryPostMessageFunction(window.postMessage, 'done', '*'); 84 tryPostMessageFunction(window.postMessage, 'done', '*');
84 </script> 85 </script>
85 </body> 86 </body>
86 </html> 87 </html>
OLDNEW
« 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