| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <p id="description"></p> | 7 <p id="description"></p> |
| 8 <pre id="console"></pre> | 8 <pre id="console"></pre> |
| 9 | 9 |
| 10 <iframe src="data:text/plain,iframe1" id="iframe1" name="iframe1"></iframe> | 10 <iframe src="data:text/plain,iframe1" id="iframe1" name="iframe1"></iframe> |
| 11 <iframe src="data:text/plain,iframe2" id="iframe2" name="iframe2"></iframe> | 11 <iframe src="data:text/plain,iframe2" id="iframe2" name="iframe2"></iframe> |
| 12 | 12 |
| 13 <script> | 13 <script> |
| 14 var wentBack = false; | 14 var wentBack = false; |
| 15 | 15 |
| 16 description('Tests that we trigger same-document navigation when history entries
are generated via fragment changes, even if the frames present in the document
change between history entries.'); | 16 description('Tests that we trigger same-document navigation when history entries
are generated via fragment changes, even if the frames present in the document
change between history entries.'); |
| 17 | 17 |
| 18 if (window.testRunner) { | 18 if (window.testRunner) { |
| 19 testRunner.dumpChildFramesAsText(); | 19 testRunner.dumpChildFramesAsText(); |
| 20 testRunner.clearBackForwardList(); | 20 testRunner.clearBackForwardList(); |
| 21 testRunner.dumpBackForwardList(); | 21 testRunner.dumpBackForwardList(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 onload = function() | 24 onload = function() |
| 25 { | 25 { |
| 26 // Run afer onload, to make sure that we can generate history entries. | 26 // Run afer onload, to make sure that we can generate history entries. |
| 27 setTimeout(beginTest, 0); | 27 requestAnimationFrame(beginTest); |
| 28 } | 28 } |
| 29 | 29 |
| 30 onpopstate = function(event) { | 30 onpopstate = function(event) { |
| 31 var loc = location.href; | 31 var loc = location.href; |
| 32 var filenameAndQuery = loc.substring(loc.lastIndexOf('/') + 1); | 32 var filenameAndQuery = loc.substring(loc.lastIndexOf('/') + 1); |
| 33 debug('popstate to state: ' + event.state + ' filename: ' + filenameAndQuery
); | 33 debug('popstate to state: ' + event.state + ' filename: ' + filenameAndQuery
); |
| 34 | 34 |
| 35 if (!location.hash) { | 35 if (!location.hash) { |
| 36 if (wentBack) { | 36 if (wentBack) { |
| 37 debug('going forward'); | 37 debug('going forward'); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 56 debug('removing iframe2'); | 56 debug('removing iframe2'); |
| 57 document.body.removeChild(document.getElementById('iframe2')); | 57 document.body.removeChild(document.getElementById('iframe2')); |
| 58 | 58 |
| 59 debug('navigating to #newState'); | 59 debug('navigating to #newState'); |
| 60 window.location.href = '#newState'; | 60 window.location.href = '#newState'; |
| 61 } | 61 } |
| 62 var jsTestIsAsync = true; | 62 var jsTestIsAsync = true; |
| 63 </script> | 63 </script> |
| 64 </body> | 64 </body> |
| 65 </html> | 65 </html> |
| OLD | NEW |