Chromium Code Reviews

Unified Diff: LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-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.
Jump to:
View side-by-side diff with in-line comments
Index: LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html
diff --git a/LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html b/LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html
index c83f9c82804dc287b0b3d479e2c07fecd8596e52..970d6c4936080fdbf5d1614303b6ab9e3a469f05 100644
--- a/LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html
+++ b/LayoutTests/fast/loader/stateobjects/resources/replacestate-in-iframe-window-child.html
@@ -1,15 +1,16 @@
<script>
-onunload = function() {
+window.onload = function() {
+ if (!sessionStorage.beganTest) {
+ sessionStorage.beganTest = true;
+ top.opener.windowLoaded();
+ }
+}
+
+window.onunload = function() {
// No page cache
}
-onpopstate = function(e) {
- if (!sessionStorage.beganTest) {
- sessionStorage.beganTest = true;
- top.opener.windowLoaded();
- return;
- }
-
+window.onpopstate = function(e) {
alert("onpopstate");
top.opener.notifyDone(window == parent ? "FAIL" : "PASS");
}

Powered by Google App Engine