Bug 1348549 - Await pageload in browser_bug822367 to avoid intermittents. r=nhnt11 draft
authorJohann Hofmann <jhofmann@mozilla.com>
Thu, 08 Jun 2017 11:57:49 +0200
changeset 591747 0b87ba4308486a819807b6b0dc6d9d322f71ab99
parent 591406 f4262773c4331d4ae139be536ce278ea9aad3436
child 632613 1a8685a6a42b0398ed0c528bc584b029272e785c
push id63161
push userbmo:jhofmann@mozilla.com
push dateFri, 09 Jun 2017 15:08:10 +0000
reviewersnhnt11
bugs1348549, 822367
milestone55.0a1
Bug 1348549 - Await pageload in browser_bug822367 to avoid intermittents. r=nhnt11 MozReview-Commit-ID: 3riSv5BbJRb
browser/base/content/test/siteIdentity/browser_bug822367.js
--- a/browser/base/content/test/siteIdentity/browser_bug822367.js
+++ b/browser/base/content/test/siteIdentity/browser_bug822367.js
@@ -19,17 +19,17 @@ add_task(async function test() {
   var newTab = BrowserTestUtils.addTab(gBrowser);
   gBrowser.selectedTab = newTab;
   gTestBrowser = gBrowser.selectedBrowser;
   newTab.linkedBrowser.stop()
 
   // Mixed Script Test
   var url = HTTPS_TEST_ROOT + "file_bug822367_1.html";
   BrowserTestUtils.loadURI(gTestBrowser, url);
-  await BrowserTestUtils.browserLoaded(gTestBrowser);
+  await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
 });
 
 // Mixed Script Test
 add_task(async function MixedTest1A() {
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   let {gIdentityHandler} = gTestBrowser.ownerGlobal;
   gIdentityHandler.disableMixedContentProtection();
@@ -43,26 +43,26 @@ add_task(async function MixedTest1B() {
       "Waited too long for mixed script to run in Test 1");
   });
 });
 
 // Mixed Display Test - Doorhanger should not appear
 add_task(async function MixedTest2() {
   var url = HTTPS_TEST_ROOT_2 + "file_bug822367_2.html";
   BrowserTestUtils.loadURI(gTestBrowser, url);
-  await BrowserTestUtils.browserLoaded(gTestBrowser);
+  await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
 
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: false});
 });
 
 // Mixed Script and Display Test - User Override should cause both the script and the image to load.
 add_task(async function MixedTest3() {
   var url = HTTPS_TEST_ROOT + "file_bug822367_3.html";
   BrowserTestUtils.loadURI(gTestBrowser, url);
-  await BrowserTestUtils.browserLoaded(gTestBrowser);
+  await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
 });
 
 add_task(async function MixedTest3A() {
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   let {gIdentityHandler} = gTestBrowser.ownerGlobal;
   gIdentityHandler.disableMixedContentProtection();
   await BrowserTestUtils.browserLoaded(gTestBrowser);
@@ -81,17 +81,17 @@ add_task(async function MixedTest3B() {
 
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: true});
 });
 
 // Location change - User override on one page doesn't propogate to another page after location change.
 add_task(async function MixedTest4() {
   var url = HTTPS_TEST_ROOT_2 + "file_bug822367_4.html";
   BrowserTestUtils.loadURI(gTestBrowser, url);
-  await BrowserTestUtils.browserLoaded(gTestBrowser);
+  await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
 });
 
 add_task(async function MixedTest4A() {
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   let {gIdentityHandler} = gTestBrowser.ownerGlobal;
   gIdentityHandler.disableMixedContentProtection();
   await BrowserTestUtils.browserLoaded(gTestBrowser);
@@ -115,17 +115,17 @@ add_task(async function MixedTest4C() {
       "Mixed script loaded in test 4 after location change!");
   });
 });
 
 // Mixed script attempts to load in a document.open()
 add_task(async function MixedTest5() {
   var url = HTTPS_TEST_ROOT + "file_bug822367_5.html";
   BrowserTestUtils.loadURI(gTestBrowser, url);
-  await BrowserTestUtils.browserLoaded(gTestBrowser);
+  await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
 });
 
 add_task(async function MixedTest5A() {
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   let {gIdentityHandler} = gTestBrowser.ownerGlobal;
   gIdentityHandler.disableMixedContentProtection();
   await BrowserTestUtils.browserLoaded(gTestBrowser);
@@ -138,17 +138,17 @@ add_task(async function MixedTest5B() {
       "Waited too long for mixed script to run in Test 5");
   });
 });
 
 // Mixed script attempts to load in a document.open() that is within an iframe.
 add_task(async function MixedTest6() {
   var url = HTTPS_TEST_ROOT_2 + "file_bug822367_6.html";
   BrowserTestUtils.loadURI(gTestBrowser, url);
-  await BrowserTestUtils.browserLoaded(gTestBrowser);
+  await BrowserTestUtils.browserLoaded(gTestBrowser, false, url);
 });
 
 add_task(async function MixedTest6A() {
   gTestBrowser.removeEventListener("load", MixedTest6A, true);
   let {gIdentityHandler} = gTestBrowser.ownerGlobal;
 
   await BrowserTestUtils.waitForCondition(
     () => gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"),