Title: [214311] trunk/LayoutTests
Revision
214311
Author
[email protected]
Date
2017-03-23 12:56:46 -0700 (Thu, 23 Mar 2017)

Log Message

REGRESSION (r214047): LayoutTest fast/events/pageshow-pagehide-on-back-cached-with-frames.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=169834

Reviewed by Alexey Proskuryakov.

Ensure that the subframes are loaded in a consistent order between test runs.

Currently the test fast/events/pageshow-pagehide-on-back-cached-with-frames.html assumes
that subframes will load in tree order. This assumption is incorrect. Therefore, we need
to explicitly manage the loading of the subframes to ensure this invariant.

* fast/events/pageshow-pagehide-on-back-cached-with-frames-expected.txt:
* fast/events/pageshow-pagehide-on-back-cached-with-frames.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (214310 => 214311)


--- trunk/LayoutTests/ChangeLog	2017-03-23 19:53:02 UTC (rev 214310)
+++ trunk/LayoutTests/ChangeLog	2017-03-23 19:56:46 UTC (rev 214311)
@@ -1,3 +1,19 @@
+2017-03-23  Daniel Bates  <[email protected]>
+
+        REGRESSION (r214047): LayoutTest fast/events/pageshow-pagehide-on-back-cached-with-frames.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=169834
+
+        Reviewed by Alexey Proskuryakov.
+
+        Ensure that the subframes are loaded in a consistent order between test runs.
+
+        Currently the test fast/events/pageshow-pagehide-on-back-cached-with-frames.html assumes
+        that subframes will load in tree order. This assumption is incorrect. Therefore, we need
+        to explicitly manage the loading of the subframes to ensure this invariant.
+
+        * fast/events/pageshow-pagehide-on-back-cached-with-frames-expected.txt:
+        * fast/events/pageshow-pagehide-on-back-cached-with-frames.html:
+
 2017-03-23  Brady Eidson  <[email protected]>
 
         WebSQL databases should not openable in private browsing.

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);
+        });
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to