Modified: trunk/LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames-expected.txt (214310 => 214311)
--- trunk/LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames-expected.txt 2017-03-23 19:53:02 UTC (rev 214310)
+++ trunk/LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames-expected.txt 2017-03-23 19:56:46 UTC (rev 214311)
@@ -1,24 +1,24 @@
-CONSOLE MESSAGE: line 21: ***Top level frame being parsed for the initial page load***
-CONSOLE MESSAGE: line 21: Subsubframe window.onload
-CONSOLE MESSAGE: line 21: Subsubframe window.onpageshow, target = [object HTMLDocument], persisted = false
-CONSOLE MESSAGE: line 21: Subframe window.onload
-CONSOLE MESSAGE: line 21: Subframe window.onpageshow, target = [object HTMLDocument], persisted = false
-CONSOLE MESSAGE: line 21: Subsubframe2 window.onload
-CONSOLE MESSAGE: line 21: Subsubframe2 window.onpageshow, target = [object HTMLDocument], persisted = false
-CONSOLE MESSAGE: line 21: Subframe2 window.onload
-CONSOLE MESSAGE: line 21: Subframe2 window.onpageshow, target = [object HTMLDocument], persisted = false
-CONSOLE MESSAGE: line 21: Main frame window.onload
-CONSOLE MESSAGE: line 21: Main frame window.onpageshow, target = [object HTMLDocument], persisted = false
-CONSOLE MESSAGE: line 21: ***Navigating top-level frame to a page that will immediately navigate back to this one***
-CONSOLE MESSAGE: line 21: Main frame window.onpagehide, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Subframe window.onpagehide, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Subsubframe window.onpagehide, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Subframe2 window.onpagehide, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Subsubframe2 window.onpagehide, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Subsubframe window.onpageshow, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Subframe window.onpageshow, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Subsubframe2 window.onpageshow, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Subframe2 window.onpageshow, target = [object HTMLDocument], persisted = true
-CONSOLE MESSAGE: line 21: Main frame window.onpageshow, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: ***Top level frame being parsed for the initial page load***
+CONSOLE MESSAGE: line 33: Subsubframe window.onload
+CONSOLE MESSAGE: line 33: Subsubframe window.onpageshow, target = [object HTMLDocument], persisted = false
+CONSOLE MESSAGE: line 33: Subframe window.onload
+CONSOLE MESSAGE: line 33: Subframe window.onpageshow, target = [object HTMLDocument], persisted = false
+CONSOLE MESSAGE: line 33: Subsubframe2 window.onload
+CONSOLE MESSAGE: line 33: Subsubframe2 window.onpageshow, target = [object HTMLDocument], persisted = false
+CONSOLE MESSAGE: line 33: Subframe2 window.onload
+CONSOLE MESSAGE: line 33: Subframe2 window.onpageshow, target = [object HTMLDocument], persisted = false
+CONSOLE MESSAGE: line 33: Main frame window.onload
+CONSOLE MESSAGE: line 33: Main frame window.onpageshow, target = [object HTMLDocument], persisted = false
+CONSOLE MESSAGE: line 33: ***Navigating top-level frame to a page that will immediately navigate back to this one***
+CONSOLE MESSAGE: line 33: Main frame window.onpagehide, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Subframe window.onpagehide, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Subsubframe window.onpagehide, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Subframe2 window.onpagehide, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Subsubframe2 window.onpagehide, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Subsubframe window.onpageshow, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Subframe window.onpageshow, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Subsubframe2 window.onpageshow, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Subframe2 window.onpageshow, target = [object HTMLDocument], persisted = true
+CONSOLE MESSAGE: line 33: Main frame window.onpageshow, target = [object HTMLDocument], persisted = true
Test pageshow/pagehide event behavior when navigating away from a page with frames, putting the page in the page cache, then back to it.
-
+
Modified: trunk/LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames.html (214310 => 214311)
--- trunk/LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames.html 2017-03-23 19:53:02 UTC (rev 214310)
+++ trunk/LayoutTests/fast/events/pageshow-pagehide-on-back-cached-with-frames.html 2017-03-23 19:56:46 UTC (rev 214311)
@@ -2,8 +2,6 @@
<body>
Test pageshow/pagehide event behavior when navigating away from a page with frames, putting the page in the page cache, then back to it.
<pre id="log"></pre>
-<iframe src=""
-<iframe src=""
</body>
<script>
@@ -13,6 +11,20 @@
testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
}
+// We explicitly chain the loading of the subframes to ensure consistent test results between runs.
+var didLoadSubframes = appendIframe("resources/pageshow-pagehide-subframe-cachable.html").then(() => appendIframe("resources/pageshow-pagehide-subframe-cachable-2.html"));
+
+function appendIframe(url)
+{
+ var promise = new Promise((resolve, reject) => {
+ var iframe = document.createElement("iframe");
+ iframe._onload_ = resolve;
+ iframe.src = ""
+ document.body.appendChild(iframe);
+ });
+ return promise;
+}
+
function log(message)
{
// Logging to the console instead of the "log" DIV in the DOM because
@@ -34,8 +46,10 @@
testRunner.notifyDone();
} else {
log("***Navigating top-level frame to a page that will immediately navigate back to this one***");
- // Location changes need to happen outside the onload handler to generate history entries.
- setTimeout(function() {window.location.href = "" + "ipt>";}, 0);
+ didLoadSubframes.then(() => {
+ // Location changes need to happen outside the onload handler to generate history entries.
+ setTimeout(() => { window.location.href = "" + "ipt>"; }, 0);
+ });
}
}