Bug 1375833 - Part 4.2 - Fix session store test case. r?mikedeboer draft
authorSamael Wang <freesamael@gmail.com>
Mon, 21 Aug 2017 18:01:40 +0800
changeset 651945 3ce75c868e6ea15169fe73564fdd8b335361e99c
parent 649817 fe1eb783520ff4dc7b8caeb6b88bcbdfe161a9b9
child 727931 42e50ce1bb8c5b799e683be696383373687fbfb3
push id75886
push userbmo:sawang@mozilla.com
push dateThu, 24 Aug 2017 07:58:14 +0000
reviewersmikedeboer
bugs1375833, 1326251
milestone57.0a1
Bug 1375833 - Part 4.2 - Fix session store test case. r?mikedeboer Previously gecko would drop all subframe history entries on reloading if there exists one or more dynamic subframes. With bug 1326251 and this bug, now that dynamic frame entries are bound to bfcache (so they're still dropped on reloading) but static entries are always kept in normal reloads. Force reload would still drop all subframes regardless they're static or dynamic, so for this test case I think we should just use a force reload. MozReview-Commit-ID: 2mZZa59RMHB
browser/components/sessionstore/test/browser_705597.js
browser/components/sessionstore/test/browser_707862.js
--- a/browser/components/sessionstore/test/browser_705597.js
+++ b/browser/components/sessionstore/test/browser_705597.js
@@ -37,21 +37,21 @@ function test() {
           ok(!entries[0].children, "history entry has no subframes");
 
           // Make sure that we reset the state.
           let blankState = { windows: [{ tabs: [{ entries: [{ url: "about:blank",
                                                               triggeringPrincipal_base64}] }]}]};
           waitForBrowserState(blankState, finish);
         });
 
-        // reload the browser to deprecate the subframes
-        browser.reload();
+        // Force reload the browser to deprecate the subframes.
+        browser.reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
       });
 
-      // create a dynamic subframe
+      // Create a dynamic subframe.
       let doc = browser.contentDocument;
       let iframe = doc.createElement("iframe");
       doc.body.appendChild(iframe);
       iframe.setAttribute("src", "about:mozilla");
     });
   });
 }
 
--- a/browser/components/sessionstore/test/browser_707862.js
+++ b/browser/components/sessionstore/test/browser_707862.js
@@ -36,21 +36,21 @@ function test() {
           whenChildCount(newEntry, 0, function() {
             // Make sure that we reset the state.
             let blankState = { windows: [{ tabs: [{ entries: [{ url: "about:blank",
                                                                 triggeringPrincipal_base64 }] }]}]};
             waitForBrowserState(blankState, finish);
           });
         });
 
-        // reload the browser to deprecate the subframes
-        browser.reload();
+        // Force reload the browser to deprecate the subframes.
+        browser.reloadWithFlags(Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
       });
 
-      // create a dynamic subframe
+      // Create a dynamic subframe.
       let doc = browser.contentDocument;
       let iframe = doc.createElement("iframe");
       doc.body.appendChild(iframe);
       iframe.setAttribute("src", "about:mozilla");
     });
   });
 
   // This test relies on the test timing out in order to indicate failure so