Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="/js-test-resources/js-test.js"></script> | 4 <script src="/js-test-resources/js-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 description("Accessing Navigator sendBeacon methods on a closed window."); | 6 description("Accessing Navigator sendBeacon methods on a closed window."); |
| 7 | 7 |
| 8 window.jsTestIsAsync = true; | 8 window.jsTestIsAsync = true; |
| 9 | 9 |
| 10 var w; | 10 var w; |
| 11 function processMessage(event) { | 11 function processMessage(event) { |
| 12 if (event.data == "opened") { | 12 if (event.data == "opened") { |
| 13 w.close(); | 13 w.close(); |
| 14 } else if (event.data == "closed") { | 14 } else if (event.data == "closed") { |
| 15 shouldThrow("w.navigator.sendBeacon()"); | 15 shouldThrow("w.navigator.sendBeacon()"); |
| 16 shouldBeFalse("w.navigator.sendBeacon('resources/blank.txt', 'detached-s hould-return false')"); | 16 shouldBeFalse("w.navigator.sendBeacon('resources/blank.txt', 'detached-s hould-return false')"); |
| 17 finishJSTest(); | 17 finishJSTest(); |
| 18 } | 18 } |
| 19 } | 19 } |
| 20 | 20 |
| 21 if (window.testRunner) { | 21 if (window.testRunner) { |
| 22 testRunner.dumpAsText(); | 22 testRunner.dumpAsText(); |
| 23 testRunner.setCanOpenWindows(); | 23 testRunner.setCanOpenWindows(); |
| 24 testRunner.waitUntilDone(); | 24 testRunner.waitUntilDone(); |
| 25 } | 25 } |
| 26 w = window.open('resources/beacon-detached-no-crash-new-window.html'); | 26 w = window.open('/js-test-resources/window-postmessage-open-close.html'); |
|
Michael van Ouwerkerk
2015/02/12 14:31:32
Can we maybe use relative urls so that things also
sof
2015/02/12 15:51:15
That would be useful to also support for http/test
| |
| 27 window.addEventListener("message", processMessage, false); | 27 window.addEventListener("message", processMessage, false); |
| 28 </script> | 28 </script> |
| OLD | NEW |