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 650259 4af4cf860de37eb97e5321ce68e333787cf9f07f
parent 649817 fe1eb783520ff4dc7b8caeb6b88bcbdfe161a9b9
child 727340 d5d4f8d65ed473d79f7078e192544f6d8976efb8
push id75315
push userbmo:sawang@mozilla.com
push dateTue, 22 Aug 2017 03:55:07 +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,18 +37,18 @@ 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
       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,18 +36,18 @@ 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
       let doc = browser.contentDocument;
       let iframe = doc.createElement("iframe");
       doc.body.appendChild(iframe);
       iframe.setAttribute("src", "about:mozilla");
     });