Bug 1213650 - Regression tests. r=Mossop
authorMike Conley <mconley@mozilla.com>
Mon, 16 Nov 2015 16:37:42 -0500
changeset 273730 b97c0c3155ecd302ad614fedc2222ae83c5df135
parent 273729 9410aa231e873b2bd5878a8dea1e7e82f0ee3eca
child 273731 1f9d9bfafd5143618083adcd50f5fcb0fead5530
push id68366
push usercbook@mozilla.com
push dateMon, 23 Nov 2015 13:31:58 +0000
treeherdermozilla-inbound@eff4131a3e4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop
bugs1213650
milestone45.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 1213650 - Regression tests. r=Mossop
browser/components/sessionstore/test/browser.ini
browser/components/sessionstore/test/browser_multiple_navigateAndRestore.js
--- a/browser/components/sessionstore/test/browser.ini
+++ b/browser/components/sessionstore/test/browser.ini
@@ -206,8 +206,10 @@ skip-if = true
 skip-if = true
 
 # Disabled on OS X:
 [browser_625016.js]
 skip-if = os == "mac"
 
 [browser_911547.js]
 [browser_send_async_message_oom.js]
+[browser_multiple_navigateAndRestore.js]
+run-if = e10s
new file mode 100644
--- /dev/null
+++ b/browser/components/sessionstore/test/browser_multiple_navigateAndRestore.js
@@ -0,0 +1,36 @@
+"use strict";
+
+const PAGE_1 = "data:text/html,<html><body>A%20regular,%20everyday,%20normal%20page.";
+const PAGE_2 = "data:text/html,<html><body>Another%20regular,%20everyday,%20normal%20page.";
+
+add_task(function*() {
+  // Load an empty, non-remote tab at about:blank...
+  let tab = gBrowser.addTab("about:blank", {
+    forceNotRemote: true,
+  });
+  gBrowser.selectedTab = tab;
+  let browser = gBrowser.selectedBrowser;
+  ok(!browser.isRemoteBrowser, "Ensure browser is not remote");
+  // Load a remote page, and then another remote page immediately
+  // after.
+  browser.loadURI(PAGE_1);
+  browser.stop();
+  browser.loadURI(PAGE_2);
+  yield BrowserTestUtils.browserLoaded(browser);
+
+  ok(browser.isRemoteBrowser, "Should have switched remoteness");
+  yield TabStateFlusher.flush(browser);
+  let state = JSON.parse(ss.getTabState(tab));
+  let entries = state.entries;
+  is(entries.length, 1, "There should only be one entry");
+  is(entries[0].url, PAGE_2, "Should have PAGE_2 as the sole history entry");
+  is(browser.currentURI.spec, PAGE_2, "Should have PAGE_2 as the browser currentURI");
+
+  yield ContentTask.spawn(browser, PAGE_2, function*(PAGE_2) {
+    docShell.QueryInterface(Ci.nsIWebNavigation);
+    is(docShell.currentURI.spec, PAGE_2,
+       "Content should have PAGE_2 as the browser currentURI");
+  });
+
+  yield BrowserTestUtils.removeTab(tab);
+});