Bug 1587784 - expect the additional onSecurityChange update that comes with a remoteness change in fission in browser_alltabslistener.js, r=dao
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Fri, 11 Oct 2019 15:12:22 +0000
changeset 497285 c51f3b5c78ad30cbebc0a94419f342a6b5350191
parent 497284 a90b5a94599371b19551906fd41384367b2eb16a
child 497286 825cabc4070898ef3f87135e10129e211371ab58
push id36681
push usercbrindusan@mozilla.com
push dateFri, 11 Oct 2019 21:50:12 +0000
treeherdermozilla-central@c5e6477c3a24 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1587784
milestone71.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 1587784 - expect the additional onSecurityChange update that comes with a remoteness change in fission in browser_alltabslistener.js, r=dao Differential Revision: https://phabricator.services.mozilla.com/D48853
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_alltabslistener.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -57,17 +57,16 @@ support-files =
   zoom_test.html
   !/image/test/mochitest/blue.png
   !/toolkit/content/tests/browser/common/mockTransfer.js
 
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_addKeywordSearch.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_alltabslistener.js]
-fail-if = fission
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_backButtonFitts.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_beforeunload_duplicate_dialogs.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_blob-channelname.js]
 # DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
 [browser_bug321000.js]
--- a/browser/base/content/test/general/browser_alltabslistener.js
+++ b/browser/base/content/test/general/browser_alltabslistener.js
@@ -179,20 +179,31 @@ var gFrontNotifications,
 var gBackgroundTab,
   gForegroundTab,
   gBackgroundBrowser,
   gForegroundBrowser,
   gTestBrowser;
 var gTestPage =
   "/browser/browser/base/content/test/general/alltabslistener.html";
 const kBasePage =
-  "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
+  "http://mochi.test:8888/browser/browser/base/content/test/general/dummy_page.html";
 var gNextTest;
 var gUsingDocumentChannel;
 
+function setExpectationForCrossDomainFrontBrowserLoad() {
+  // In fission, we swap remoteness for this load, and we'll get sent a
+  // notification to ensure the security state shown by the browser remains
+  // correct after the remoteness change - we need to account for that:
+  if (gFissionBrowser) {
+    gFrontNotifications = ["onSecurityChange"].concat(gAllNotifications);
+  } else {
+    gFrontNotifications = gAllNotifications;
+  }
+}
+
 async function test() {
   waitForExplicitFinish();
 
   gBackgroundTab = BrowserTestUtils.addTab(gBrowser);
   gForegroundTab = BrowserTestUtils.addTab(gBrowser);
   gBackgroundBrowser = gBrowser.getBrowserForTab(gBackgroundTab);
   gForegroundBrowser = gBrowser.getBrowserForTab(gForegroundTab);
   gBrowser.selectedTab = gForegroundTab;
@@ -202,16 +213,17 @@ async function test() {
   );
 
   gAllNotifications = [
     "onStateChange",
     "onLocationChange",
     "onSecurityChange",
     "onStateChange",
   ];
+
   // DocumentChannel issues an extra onStateChange at the
   // start, when it switches over to the real channel
   if (gUsingDocumentChannel) {
     gAllNotifications.unshift("onStateChange");
   }
 
   // We must wait until a page has completed loading before
   // starting tests or we get notifications from that
@@ -238,23 +250,23 @@ function runTest(browser, url, next) {
   BrowserTestUtils.loadURI(browser, url);
 }
 
 function startTest1() {
   info("\nTest 1");
   gBrowser.addProgressListener(gFrontProgressListener);
   gBrowser.addTabsProgressListener(gAllProgressListener);
 
-  gFrontNotifications = gAllNotifications;
+  setExpectationForCrossDomainFrontBrowserLoad();
   runTest(gForegroundBrowser, "http://example.org" + gTestPage, startTest2);
 }
 
 function startTest2() {
   info("\nTest 2");
-  gFrontNotifications = gAllNotifications;
+  setExpectationForCrossDomainFrontBrowserLoad();
   runTest(gForegroundBrowser, "https://example.com" + gTestPage, startTest3);
 }
 
 function startTest3() {
   info("\nTest 3");
   gFrontNotifications = [];
   runTest(gBackgroundBrowser, "http://example.org" + gTestPage, startTest4);
 }
@@ -273,17 +285,17 @@ function startTest5() {
     gForegroundBrowser,
   ];
   [gForegroundTab, gBackgroundTab] = [gBackgroundTab, gForegroundTab];
   // Avoid the onLocationChange this will fire
   gBrowser.removeProgressListener(gFrontProgressListener);
   gBrowser.selectedTab = gForegroundTab;
   gBrowser.addProgressListener(gFrontProgressListener);
 
-  gFrontNotifications = gAllNotifications;
+  setExpectationForCrossDomainFrontBrowserLoad();
   runTest(gForegroundBrowser, "http://example.org" + gTestPage, startTest6);
 }
 
 function startTest6() {
   info("\nTest 6");
   gFrontNotifications = [];
   runTest(gBackgroundBrowser, "http://example.org" + gTestPage, finishTest);
 }