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

Unified Diff: LayoutTests/fast/loader/stateobjects/pushstate-object-types.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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/loader/stateobjects/pushstate-object-types.html
diff --git a/LayoutTests/fast/loader/stateobjects/pushstate-object-types.html b/LayoutTests/fast/loader/stateobjects/pushstate-object-types.html
index 797357997d1a3a24ee2ab1ae30421009bc5b6b93..097aec4ec8d2e9c72391bee6092c8370f4dcf5a4 100644
--- a/LayoutTests/fast/loader/stateobjects/pushstate-object-types.html
+++ b/LayoutTests/fast/loader/stateobjects/pushstate-object-types.html
@@ -39,24 +39,13 @@ history.pushState([FileList], "FileList entry");
history.back();
}
-var beganTest = false;
-
onpopstate = function(event)
{
- // The first time popstate fires, it's because the page has finished loading.
- // Only then can we begin the test.
- if (!beganTest) {
- beganTest = true;
- runTest();
- return;
- }
-
if (event.state instanceof Date)
log("State popped - " + event.state.getTime() + " (type " + typeof event.state + ")");
else
log("State popped - " + event.state + " (type " + typeof event.state + ")");
-
if (event.state != "FirstEntry")
history.back();
else if (window.testRunner)
@@ -64,7 +53,7 @@ onpopstate = function(event)
}
</script>
-<body>
+<body onload="runTest();">
<p>
This test calls pushState with state objects of all the different object types supported by the HTML5 "internal structured cloning algorithm" and makes sure the events contain the expected objects when the states are popped.
</p>

Powered by Google App Engine
This is Rietveld 408576698