Bug 1330822 - Remove CPOWs from browser_mixedcontent_securityflags.js. r=Felipe
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 15 Nov 2016 15:12:17 -0800
changeset 374999 a5cc4b8910228e4530e68b1f4a4695f804ec40b4
parent 374998 538aec2ed89e8e70ffbf9488e83a54f80d4443a3
child 375000 a66860c81eaf8f83e38ab184c1d1fa9e5564edcc
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFelipe
bugs1330822
milestone53.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 1330822 - Remove CPOWs from browser_mixedcontent_securityflags.js. r=Felipe
browser/base/content/test/general/browser_mixedcontent_securityflags.js
--- a/browser/base/content/test/general/browser_mixedcontent_securityflags.js
+++ b/browser/base/content/test/general/browser_mixedcontent_securityflags.js
@@ -9,57 +9,62 @@
 //   blocked), reload the page, and check the flags again.
 // * We override protection so all mixed content can load and check the
 //   flags again.
 
 const TEST_URI = "https://example.com/browser/browser/base/content/test/general/test-mixedcontent-securityerrors.html";
 const PREF_DISPLAY = "security.mixed_content.block_display_content";
 const PREF_ACTIVE = "security.mixed_content.block_active_content";
 var gTestBrowser = null;
-waitForExplicitFinish();
 
 registerCleanupFunction(function() {
   // Set preferences back to their original values
   Services.prefs.clearUserPref(PREF_DISPLAY);
   Services.prefs.clearUserPref(PREF_ACTIVE);
   gBrowser.removeCurrentTab();
 });
 
 add_task(function* blockMixedActiveContentTest() {
   // Turn on mixed active blocking and mixed display loading and load the page.
   Services.prefs.setBoolPref(PREF_DISPLAY, false);
   Services.prefs.setBoolPref(PREF_ACTIVE, true);
 
   let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URI);
   gTestBrowser = gBrowser.getBrowserForTab(tab);
 
-  is(gTestBrowser.docShell.hasMixedDisplayContentBlocked, false, "hasMixedDisplayContentBlocked flag has been set");
-  is(gTestBrowser.docShell.hasMixedActiveContentBlocked, true, "hasMixedActiveContentBlocked flag has been set");
-  is(gTestBrowser.docShell.hasMixedDisplayContentLoaded, true, "hasMixedDisplayContentLoaded flag has been set");
-  is(gTestBrowser.docShell.hasMixedActiveContentLoaded, false, "hasMixedActiveContentLoaded flag has been set");
+  yield ContentTask.spawn(gTestBrowser, null, function() {
+    is(docShell.hasMixedDisplayContentBlocked, false, "hasMixedDisplayContentBlocked flag has been set");
+    is(docShell.hasMixedActiveContentBlocked, true, "hasMixedActiveContentBlocked flag has been set");
+    is(docShell.hasMixedDisplayContentLoaded, true, "hasMixedDisplayContentLoaded flag has been set");
+    is(docShell.hasMixedActiveContentLoaded, false, "hasMixedActiveContentLoaded flag has been set");
+  });
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: true});
 
   // Turn on mixed active and mixed display blocking and reload the page.
   Services.prefs.setBoolPref(PREF_DISPLAY, true);
   Services.prefs.setBoolPref(PREF_ACTIVE, true);
 
   gBrowser.reload();
   yield BrowserTestUtils.browserLoaded(gTestBrowser);
 
-  is(gTestBrowser.docShell.hasMixedDisplayContentBlocked, true, "hasMixedDisplayContentBlocked flag has been set");
-  is(gTestBrowser.docShell.hasMixedActiveContentBlocked, true, "hasMixedActiveContentBlocked flag has been set");
-  is(gTestBrowser.docShell.hasMixedDisplayContentLoaded, false, "hasMixedDisplayContentLoaded flag has been set");
-  is(gTestBrowser.docShell.hasMixedActiveContentLoaded, false, "hasMixedActiveContentLoaded flag has been set");
+  yield ContentTask.spawn(gTestBrowser, null, function() {
+    is(docShell.hasMixedDisplayContentBlocked, true, "hasMixedDisplayContentBlocked flag has been set");
+    is(docShell.hasMixedActiveContentBlocked, true, "hasMixedActiveContentBlocked flag has been set");
+    is(docShell.hasMixedDisplayContentLoaded, false, "hasMixedDisplayContentLoaded flag has been set");
+    is(docShell.hasMixedActiveContentLoaded, false, "hasMixedActiveContentLoaded flag has been set");
+  });
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 });
 
 add_task(function* overrideMCB() {
   // Disable mixed content blocking (reloads page) and retest
   let {gIdentityHandler} = gTestBrowser.ownerGlobal;
   gIdentityHandler.disableMixedContentProtection();
   yield BrowserTestUtils.browserLoaded(gTestBrowser);
 
-  is(gTestBrowser.docShell.hasMixedDisplayContentLoaded, true, "hasMixedDisplayContentLoaded flag has not been set");
-  is(gTestBrowser.docShell.hasMixedActiveContentLoaded, true, "hasMixedActiveContentLoaded flag has not been set");
-  is(gTestBrowser.docShell.hasMixedDisplayContentBlocked, false, "second hasMixedDisplayContentBlocked flag has been set");
-  is(gTestBrowser.docShell.hasMixedActiveContentBlocked, false, "second hasMixedActiveContentBlocked flag has been set");
+  yield ContentTask.spawn(gTestBrowser, null, function() {
+    is(docShell.hasMixedDisplayContentLoaded, true, "hasMixedDisplayContentLoaded flag has not been set");
+    is(docShell.hasMixedActiveContentLoaded, true, "hasMixedActiveContentLoaded flag has not been set");
+    is(docShell.hasMixedDisplayContentBlocked, false, "second hasMixedDisplayContentBlocked flag has been set");
+    is(docShell.hasMixedActiveContentBlocked, false, "second hasMixedActiveContentBlocked flag has been set");
+  });
   assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: true});
 });