Bug 1375833 - Part 4.2 - Fix session store test case. r=mikedeboer
authorSamael Wang <freesamael@gmail.com>
Mon, 21 Aug 2017 18:01:40 +0800
changeset 377241 8a5a636429ea000a738efd1d9189c2a5b696de8d
parent 377240 e56d79b257ac134c1f2094b34629ecacd282b313
child 377242 75ae0405a90d71fd92514dc4d153d04fce7f82e5
push id49807
push userryanvm@gmail.com
push dateMon, 28 Aug 2017 13:45:50 +0000
treeherderautoland@8a5a636429ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1375833, 1326251
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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