OLD | NEW |
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.layoutTestController) { | 7 if (window.layoutTestController) { |
8 layoutTestController.dumpAsText(); | 8 layoutTestController.dumpAsText(); |
9 layoutTestController.waitUntilDone(); | 9 layoutTestController.waitUntilDone(); |
10 } | 10 } |
(...skipping 28 matching lines...) Expand all Loading... |
39 tryPostMessageFunction(window.postMessage, first, second, third, shouldFail)
; | 39 tryPostMessageFunction(window.postMessage, first, second, third, shouldFail)
; |
40 tryPostMessageFunction(window.webkitPostMessage, first, second, third, shoul
dFail); | 40 tryPostMessageFunction(window.webkitPostMessage, first, second, third, shoul
dFail); |
41 } | 41 } |
42 | 42 |
43 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 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>"; |
44 | 44 |
45 tryPostMessage('1', '*', 1, true); | 45 tryPostMessage('1', '*', 1, true); |
46 tryPostMessage('2', '*', 'c', true); | 46 tryPostMessage('2', '*', 'c', true); |
47 tryPostMessage('3', '*', { x: 1 }, true); | 47 tryPostMessage('3', '*', { x: 1 }, true); |
48 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 |
| 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]); |
| 54 var channel1a = new MessageChannel; |
| 55 tryPostMessageFunction(window.postMessage, '7a', [channel1a.port1, channel1a.por
t2], '*'); |
53 var channel2 = new MessageChannel; | 56 var channel2 = new MessageChannel; |
54 tryPostMessageFunction(window.webkitPostMessage, '7', '*', [channel2.port1, chan
nel2.port2]); | 57 tryPostMessageFunction(window.webkitPostMessage, '7', '*', [channel2.port1, chan
nel2.port2]); |
55 var channel3 = new MessageChannel; | 58 var channel3 = new MessageChannel; |
56 tryPostMessage(2147483648, '*', null); | 59 tryPostMessage(2147483648, '*', null); |
57 tryPostMessageFunction(window.postMessage, channel3.port1, '*', [channel3.port1,
channel3.port2]); | 60 tryPostMessageFunction(window.postMessage, channel3.port1, '*', [channel3.port1,
channel3.port2]); |
58 var channel4 = new MessageChannel; | 61 var channel4 = new MessageChannel; |
59 tryPostMessageFunction(window.webkitPostMessage, channel4.port1, '*', [channel4.
port1, channel4.port2]); | 62 tryPostMessageFunction(window.webkitPostMessage, channel4.port1, '*', [channel4.
port1, channel4.port2]); |
60 var channel5 = new MessageChannel; | 63 var channel5 = new MessageChannel; |
61 tryPostMessageFunction(window.webkitPostMessage, [channel5.port1, channel5.port2
], '*', [channel5.port1, channel5.port2]); | 64 tryPostMessageFunction(window.webkitPostMessage, [channel5.port1, channel5.port2
], '*', [channel5.port1, channel5.port2]); |
62 | 65 |
(...skipping 12 matching lines...) Expand all Loading... |
75 } | 78 } |
76 else { | 79 else { |
77 console.innerHTML += "PASS: view neutered<br>" | 80 console.innerHTML += "PASS: view neutered<br>" |
78 } | 81 } |
79 | 82 |
80 | 83 |
81 tryPostMessageFunction(window.postMessage, 'done', '*'); | 84 tryPostMessageFunction(window.postMessage, 'done', '*'); |
82 </script> | 85 </script> |
83 </body> | 86 </body> |
84 </html> | 87 </html> |
OLD | NEW |