Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: LayoutTests/fast/loader/stateobjects/resources/pushstate-in-iframe-child.html

Issue 136463002: Don't fire popstate event on initial document load (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix replacestate-in-iframe test Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
8 onpopstate = function() { 6 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
15 var topWin = top; 7 var topWin = top;
16 // Verify that we are still in an iframe 8 // Verify that we are still in an iframe
17 if (topWin == window) { 9 if (topWin == window) {
18 topWin.document.body.innerHTML = "FAIL"; 10 topWin.document.body.innerHTML = "FAIL";
19 } else { 11 } else {
20 topWin.document.body.innerHTML = "PASS"; 12 topWin.document.body.innerHTML = "PASS";
21 } 13 }
22 if (topWin.testRunner) 14 if (topWin.testRunner)
23 topWin.testRunner.notifyDone(); 15 topWin.testRunner.notifyDone();
24 } 16 }
25 17
26 onload = function() { 18 onload = function() {
27 history.pushState(null, null); 19 history.pushState(null, null);
28 history.pushState(null, null); 20 history.pushState(null, null);
29 setTimeout(function() { history.back() }, 0); 21 setTimeout(function() { history.back() }, 0);
30 } 22 }
31 </script> 23 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698