OLD | NEW |
1 <html> | 1 <!DOCTYPE HTML> |
2 <body> | 2 <script src="/js-test-resources/js-test.js"></script> |
3 <p>Navigate while an EventSource reconnect timer is waiting, then have the recon
nect timer trigger before the page unloads. We pass if we don't crash. | |
4 <script> | 3 <script> |
| 4 description("Navigate while an EventSource reconnect timer is waiting, then have
the reconnect timer trigger before the page unloads."); |
| 5 |
5 if (window.testRunner) { | 6 if (window.testRunner) { |
6 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
7 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
8 } | 9 } |
9 | 10 |
10 var navigateWasCalled = false; | 11 var navigateWasCalled = false; |
11 | 12 |
12 function navigate() { | 13 function navigate() { |
13 if (navigateWasCalled) | 14 if (navigateWasCalled) |
14 return; | 15 return; |
15 navigateWasCalled = true; | 16 navigateWasCalled = true; |
16 window.location = "resources/wait-then-notify-done.php"; | 17 window.location = "resources/wait-then-notify-done.php"; |
17 } | 18 } |
18 | 19 |
19 var es = new EventSource("resources/reconnect.php"); | 20 var es = new EventSource("resources/reconnect.php"); |
20 es.onerror = function() { | 21 es.onerror = function() { |
21 setTimeout(navigate, 0); | 22 setTimeout(navigate, 0); |
22 }; | 23 }; |
23 </script> | 24 </script> |
24 </body> | 25 </body> |
25 </html> | 26 </html> |
OLD | NEW |