OLD | NEW |
1 <script> | 1 <script> |
2 onunload = function() { | 2 onunload = function() { |
3 // disable page cache | 3 // disable page cache |
4 } | 4 } |
5 | 5 |
| 6 var pageLoaded = false; |
| 7 |
6 onpopstate = function() { | 8 onpopstate = function() { |
| 9 // The first time popstate fires, it's because the page has finished loading. |
| 10 if (!pageLoaded) { |
| 11 pageLoaded = true; |
| 12 return; |
| 13 } |
| 14 |
7 var topWin = top; | 15 var topWin = top; |
8 // Verify that we are still in an iframe | 16 // Verify that we are still in an iframe |
9 if (topWin == window) { | 17 if (topWin == window) { |
10 topWin.document.body.innerHTML = "FAIL"; | 18 topWin.document.body.innerHTML = "FAIL"; |
11 } else { | 19 } else { |
12 topWin.document.body.innerHTML = "PASS"; | 20 topWin.document.body.innerHTML = "PASS"; |
13 } | 21 } |
14 if (topWin.testRunner) | 22 if (topWin.testRunner) |
15 topWin.testRunner.notifyDone(); | 23 topWin.testRunner.notifyDone(); |
16 } | 24 } |
17 | 25 |
18 onload = function() { | 26 onload = function() { |
19 history.pushState(null, null); | 27 history.pushState(null, null); |
20 history.pushState(null, null); | 28 history.pushState(null, null); |
21 setTimeout(function() { history.back() }, 0); | 29 setTimeout(function() { history.back() }, 0); |
22 } | 30 } |
23 </script> | 31 </script> |
OLD | NEW |