| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script> |
| 4 // Induces an attempt to hash navigate while the SUCCESS_URL is being committed
to the frame. |
| 5 // The tests succeeds if the SUCCESS_URL is loaded into the frame. |
| 6 |
| 7 function doIt() { |
| 8 var SUCCESS_URL = "navigate-during-commit.success.html"; |
| 9 var VERY_SLOW_URL = "very-slow.php"; |
| 10 syncXhr(SUCCESS_URL); // Get it in the cache. |
| 11 asyncXhr(VERY_SLOW_URL + "?" + window.randomNumber); |
| 12 window.location = SUCCESS_URL; |
| 13 } |
| 14 |
| 15 function asyncXhr(url) { |
| 16 var xhr = new XMLHttpRequest(); |
| 17 xhr.open("GET", url, true); |
| 18 xhr.onreadystatechange = function() { if (xhr.readyState == 4) { window.locati
on.hash="hashnav"; } } |
| 19 xhr.send(); |
| 20 } |
| 21 |
| 22 function syncXhr(url) { |
| 23 var syncXhr = new XMLHttpRequest(); |
| 24 syncXhr.open("GET", url, false); |
| 25 syncXhr.send(); |
| 26 } |
| 27 |
| 28 </script> |
| 29 </head> |
| 30 <body onload="doIt()"> |
| 31 </body> |
| 32 </html> |
| OLD | NEW |