Bug 1186925 - Convert tests using bad-content notification to use gIdentityHandler;r=tanvi
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 07 Aug 2015 15:22:52 -0700
changeset 288568 2e33ac0bb341812efa0f1a7e49837c9eced1f5ed
parent 288567 907891e1c2112a703439aa885d3e47ac905878ff
child 288569 5ea0445e2eff32d8215a461d7d1a1ac0863d03b0
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstanvi
bugs1186925
milestone42.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 1186925 - Convert tests using bad-content notification to use gIdentityHandler;r=tanvi
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_bug1045809.js
browser/base/content/test/general/browser_bug822367.js
browser/base/content/test/general/browser_bug902156.js
browser/base/content/test/general/browser_bug906190.js
browser/base/content/test/general/browser_mcb_redirect.js
browser/base/content/test/general/browser_mixedcontent_securityflags.js
browser/base/content/test/general/head.js
browser/devtools/webconsole/test/browser.ini
browser/devtools/webconsole/test/browser_webconsole_block_mixedcontent_securityerrors.js
dom/base/test/browser.ini
dom/base/test/browser_bug902350.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -254,22 +254,25 @@ skip-if = os == "mac" # Bug 1102331 - do
 [browser_bug734076.js]
 [browser_bug735471.js]
 [browser_bug749738.js]
 [browser_bug763468_perwindowpb.js]
 [browser_bug767836_perwindowpb.js]
 [browser_bug783614.js]
 [browser_bug817947.js]
 [browser_bug822367.js]
+tags = mcb
 [browser_bug832435.js]
 [browser_bug839103.js]
 [browser_bug880101.js]
 [browser_bug882977.js]
 [browser_bug902156.js]
+tags = mcb
 [browser_bug906190.js]
+tags = mcb
 skip-if = buildapp == "mulet" || e10s # Bug 1093642 - test manipulates content and relies on content focus
 [browser_mixedContentFromOnunload.js]
 [browser_bug970746.js]
 [browser_bug1015721.js]
 skip-if = os == 'win' || e10s # Bug 1159268 - Need a content-process safe version of synthesizeWheel
 [browser_bug1064280_changeUrlInPinnedTab.js]
 [browser_bug1070778.js]
 [browser_canonizeURL.js]
@@ -325,16 +328,17 @@ skip-if = toolkit == "windows" # Disable
 skip-if = os == "linux" # Linux: Intermittent failures, bug 917535
 [browser_locationBarExternalLoad.js]
 [browser_menuButtonFitts.js]
 skip-if = os != "win" # The Fitts Law menu button is only supported on Windows (bug 969376)
 [browser_middleMouse_noJSPaste.js]
 [browser_minimize.js]
 skip-if = e10s # Bug 1100664 - test directly access content docShells (TypeError: gBrowser.docShell is null)
 [browser_mixedcontent_securityflags.js]
+tags = mcb
 [browser_notification_tab_switching.js]
 skip-if = buildapp == 'mulet' || e10s # Bug 1100662 - content access causing uncaught exception - Error: cannot ipc non-cpow object at chrome://mochitests/content/browser/browser/base/content/test/general/browser_notification_tab_switching.js:32 (or in RemoteAddonsChild.jsm)
 [browser_offlineQuotaNotification.js]
 skip-if = buildapp == 'mulet' || e10s # Bug 1093603 - test breaks with PopupNotifications.panel.firstElementChild is null
 [browser_overflowScroll.js]
 [browser_pageInfo.js]
 skip-if = buildapp == 'mulet'
 [browser_page_style_menu.js]
@@ -484,24 +488,26 @@ skip-if = e10s # Bug 1094240 - has findb
 [browser_no_mcb_on_http_site.js]
 [browser_bug1104165-switchtab-decodeuri.js]
 [browser_bug1003461-switchtab-override.js]
 [browser_bug1024133-switchtab-override-keynav.js]
 [browser_bug1025195_switchToTabHavingURI_aOpenParams.js]
 [browser_addCertException.js]
 skip-if = e10s # Bug 1100687 - test directly manipulates content (content.document.getElementById)
 [browser_bug1045809.js]
+tags = mcb
 [browser_e10s_switchbrowser.js]
 [browser_e10s_about_process.js]
 [browser_e10s_chrome_process.js]
 [browser_e10s_javascript.js]
 [browser_blockHPKP.js]
 tags = psm
 skip-if = e10s # bug 1100687 - test directly manipulates content (content.document.getElementById)
 [browser_mcb_redirect.js]
+tags = mcb
 [browser_windowactivation.js]
 [browser_contextmenu_childprocess.js]
 [browser_bug963945.js]
 [browser_readerMode.js]
 support-files =
   readerModeArticle.html
 [browser_readerMode_hidden_nodes.js]
 support-files =
--- a/browser/base/content/test/general/browser_bug1045809.js
+++ b/browser/base/content/test/general/browser_bug1045809.js
@@ -30,48 +30,33 @@ add_task(function* () {
   yield* test2(gBrowser.getBrowserForTab(tab));
 
   // Test 3: mixed content must be blocked again
   yield promiseTabLoadEvent(tab);
   yield* test3(gBrowser.getBrowserForTab(tab));
 });
 
 function* test1(gTestBrowser) {
-  var notification =
-    PopupNotifications.getNotification("bad-content", gTestBrowser);
-  isnot(notification, null, "Mixed Content Doorhanger did appear in Test1");
-  yield promiseNotificationShown(notification);
-  isnot(PopupNotifications.panel.firstChild.isMixedContentBlocked, 0,
-    "Mixed Content is being blocked in Test1");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   var x = content.document.getElementsByTagName('iframe')[0].contentDocument.getElementById('mixedContentContainer');
   is(x, null, "Mixed Content is NOT to be found in Test1");
 
   // Disable Mixed Content Protection for the page (and reload)
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
+  gIdentityHandler.disableMixedContentProtection();
 }
 
 function* test2(gTestBrowser) {
-  var notification =
-    PopupNotifications.getNotification("bad-content", gTestBrowser);
-  isnot(notification, null, "Mixed Content Doorhanger did appear in Test2");
-  yield promiseNotificationShown(notification);
-  is(PopupNotifications.panel.firstChild.isMixedContentBlocked, 0,
-    "Mixed Content is NOT being blocked in Test2");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
 
   var x = content.document.getElementsByTagName('iframe')[0].contentDocument.getElementById('mixedContentContainer');
   isnot(x, null, "Mixed Content is to be found in Test2");
 
   // Re-enable Mixed Content Protection for the page (and reload)
-  PopupNotifications.panel.firstChild.enableMixedContentProtection();
+  gIdentityHandler.enableMixedContentProtection();
 }
 
 function* test3(gTestBrowser) {
-  var notification =
-    PopupNotifications.getNotification("bad-content", gTestBrowser);
-  isnot(notification, null, "Mixed Content Doorhanger did appear in Test3");
-  yield promiseNotificationShown(notification);
-  isnot(PopupNotifications.panel.firstChild.isMixedContentBlocked, 0,
-    "Mixed Content is being blocked in Test3");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   var x = content.document.getElementsByTagName('iframe')[0].contentDocument.getElementById('mixedContentContainer');
   is(x, null, "Mixed Content is NOT to be found in Test3");
 }
--- a/browser/base/content/test/general/browser_bug822367.js
+++ b/browser/base/content/test/general/browser_bug822367.js
@@ -45,21 +45,21 @@ function test() {
   var url = gHttpTestRoot + "file_bug822367_1.html";
   gTestBrowser.contentWindow.location = url;
 }
 
 // Mixed Script Test
 function MixedTest1A() {
   gTestBrowser.removeEventListener("load", MixedTest1A, true);
   gTestBrowser.addEventListener("load", MixedTest1B, true);
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "Mixed Content Doorhanger did appear");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked");
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
+
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
+
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
 }
 function MixedTest1B() {
   waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest1C, "Waited too long for mixed script to run in Test 1");
 }
 function MixedTest1C() {
   ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 1");
   gTestBrowser.removeEventListener("load", MixedTest1B, true);
   MixedTest2();
@@ -68,75 +68,74 @@ function MixedTest1C() {
 //Mixed Display Test - Doorhanger should not appear
 function MixedTest2() {
   gTestBrowser.addEventListener("load", MixedTest2A, true);
   var url = gHttpTestRoot2 + "file_bug822367_2.html";
   gTestBrowser.contentWindow.location = url;
 }
 
 function MixedTest2A() {
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(!notification, "Mixed Content Doorhanger did not appear for mixed display content!");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: false});
   MixedTest3();
 }
 
 // Mixed Script and Display Test - User Override should cause both the script and the image to load.
 function MixedTest3() {
   gTestBrowser.removeEventListener("load", MixedTest2A, true);
   gTestBrowser.addEventListener("load", MixedTest3A, true);
   var url = gHttpTestRoot + "file_bug822367_3.html";
   gTestBrowser.contentWindow.location = url;
 }
 function MixedTest3A() {
   gTestBrowser.removeEventListener("load", MixedTest3A, true);
   gTestBrowser.addEventListener("load", MixedTest3B, true);
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "Mixed Content Doorhanger did appear for test 3");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in test 3");
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
+
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
+
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
 }
 function MixedTest3B() {
   waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest3C, "Waited too long for mixed script to run in Test 3");
 }
 function MixedTest3C() {
   waitForCondition(function() content.document.getElementById('p2').innerHTML == "bye", MixedTest3D, "Waited too long for mixed image to load in Test 3");
 }
 function MixedTest3D() {
   ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 3");
   ok(content.document.getElementById('p2').innerHTML == "bye","Mixed image didn't load in Test 3");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: true});
   MixedTest4();
 }
 
 // Location change - User override on one page doesn't propogate to another page after location change.
 function MixedTest4() {
   gTestBrowser.removeEventListener("load", MixedTest3B, true);
   gTestBrowser.addEventListener("load", MixedTest4A, true);
   var url = gHttpTestRoot2 + "file_bug822367_4.html";
   gTestBrowser.contentWindow.location = url;
 }
 function MixedTest4A() {
   gTestBrowser.removeEventListener("load", MixedTest4A, true);
   gTestBrowser.addEventListener("load", MixedTest4B, true);
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "Mixed Content Doorhanger did appear for Test 4");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 4");
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
+
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
+
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
 }
 function MixedTest4B() {
   waitForCondition(function() content.document.location == gHttpTestRoot + "file_bug822367_4B.html", MixedTest4C, "Waited too long for mixed script to run in Test 4");
 }
 function MixedTest4C() {
   ok(content.document.location == gHttpTestRoot + "file_bug822367_4B.html", "Location didn't change in test 4");
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "Mixed Content Doorhanger did appear after location change in Test 4");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in test 4");
-  notification.remove();
+
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
+
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
   waitForCondition(function() content.document.getElementById('p1').innerHTML == "", MixedTest4D, "Mixed script loaded in test 4 after location change!");
 }
 function MixedTest4D() {
   ok(content.document.getElementById('p1').innerHTML == "","p1.innerHTML changed; mixed script loaded after location change in Test 4");
   MixedTest5();
 }
 
 // Mixed script attempts to load in a document.open()
@@ -144,21 +143,21 @@ function MixedTest5() {
   gTestBrowser.removeEventListener("load", MixedTest4B, true);
   gTestBrowser.addEventListener("load", MixedTest5A, true);
   var url = gHttpTestRoot + "file_bug822367_5.html";
   gTestBrowser.contentWindow.location = url;
 }
 function MixedTest5A() {
   gTestBrowser.removeEventListener("load", MixedTest5A, true);
   gTestBrowser.addEventListener("load", MixedTest5B, true);
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "Mixed Content Doorhanger did appear for Test 5");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 5");
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
+
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
+
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
 }
 function MixedTest5B() {
   waitForCondition(function() content.document.getElementById('p1').innerHTML == "hello", MixedTest5C, "Waited too long for mixed script to run in Test 5");
 }
 function MixedTest5C() {
   ok(content.document.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 5");
   MixedTest6();
 }
@@ -167,34 +166,36 @@ function MixedTest5C() {
 function MixedTest6() {
   gTestBrowser.removeEventListener("load", MixedTest5B, true);
   gTestBrowser.addEventListener("load", MixedTest6A, true);
   var url = gHttpTestRoot2 + "file_bug822367_6.html";
   gTestBrowser.contentWindow.location = url;
 }
 function MixedTest6A() {
   gTestBrowser.removeEventListener("load", MixedTest6A, true);
-  waitForCondition(function() PopupNotifications.getNotification("bad-content", gTestBrowser), MixedTest6B, "waited too long for doorhanger");
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  waitForCondition(() => gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"), MixedTest6B, "Waited too long for control center to get mixed active blocked state");
 }
 
 function MixedTest6B() {
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "Mixed Content Doorhanger did appear for Test 6");
   gTestBrowser.addEventListener("load", MixedTest6C, true);
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 6");
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
+
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
+
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
 }
 
 function MixedTest6C() {
   gTestBrowser.removeEventListener("load", MixedTest6C, true);
   waitForCondition(function() {
     try {
       return content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello";
     } catch (e) {
       return false;
     }
   }, MixedTest6D, "Waited too long for mixed script to run in Test 6");
 }
 function MixedTest6D() {
   ok(content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 6");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
   MixedTestsCompleted();
 }
--- a/browser/base/content/test/general/browser_bug902156.js
+++ b/browser/base/content/test/general/browser_bug902156.js
@@ -1,27 +1,27 @@
 /*
  * Description of the Tests for
  *  - Bug 902156: Persist "disable protection" option for Mixed Content Blocker
  *
  * 1. Navigate to the same domain via document.location
  *    - Load a html page which has mixed content
- *    - Doorhanger to disable protection appears - we disable it
+ *    - Control Center button to disable protection appears - we disable it
  *    - Load a new page from the same origin using document.location
- *    - Doorhanger should not appear anymore!
+ *    - Control Center button should not appear anymore!
  *
  * 2. Navigate to the same domain via simulateclick for a link on the page
  *    - Load a html page which has mixed content
- *    - Doorhanger to disable protection appears - we disable it
+ *    - Control Center button to disable protection appears - we disable it
  *    - Load a new page from the same origin simulating a click
- *    - Doorhanger should not appear anymore!
+ *    - Control Center button should not appear anymore!
  *
  * 3. Navigate to a differnet domain and show the content is still blocked
  *    - Load a different html page which has mixed content
- *    - Doorhanger to disable protection should appear again because
+ *    - Control Center button to disable protection should appear again because
  *      we navigated away from html page where we disabled the protection.
  *
  * Note, for all tests we set gHttpTestRoot to use 'https'.
  */
 
 const PREF_ACTIVE = "security.mixed_content.block_active_content";
 
 // We alternate for even and odd test cases to simulate different hosts
@@ -45,24 +45,21 @@ function cleanUpAfterTests() {
 //------------------------ Test 1 ------------------------------
 
 function test1A() {
   // Removing EventListener because we have to register a new
   // one once the page is loaded with mixed content blocker disabled
   gTestBrowser.removeEventListener("load", test1A, true);
   gTestBrowser.addEventListener("load", test1B, true);
 
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test1A!");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test1A!");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   // Disable Mixed Content Protection for the page (and reload)
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
-  notification.remove();
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
 }
 
 function test1B() {
   var expected = "Mixed Content Blocker disabled";
   waitForCondition(
     function() content.document.getElementById('mctestdiv').innerHTML == expected,
     test1C, "Error: Waited too long for mixed script to run in Test 1B");
 }
@@ -78,23 +75,19 @@ function test1C() {
 
   var url = gHttpTestRoot1 + "file_bug902156_2.html";
   gTestBrowser.contentWindow.location = url;
 }
 
 function test1D() {
   gTestBrowser.removeEventListener("load", test1D, true);
 
-  // The Doorhanger should appear but isMixedContentBlocked should be NOT true,
+  // The Control Center button should appear but isMixedContentBlocked should be NOT true,
   // because our decision of disabling the mixed content blocker is persistent.
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test1D!");
-  notification.reshow();
-  ok(!PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is NOT being blocked in Test1D!");
-  notification.remove();
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
 
   var actual = content.document.getElementById('mctestdiv').innerHTML;
   is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1D");
 
   // move on to Test 2
   test2();
 }
 
@@ -107,24 +100,21 @@ function test2() {
 }
 
 function test2A() {
   // Removing EventListener because we have to register a new
   // one once the page is loaded with mixed content blocker disabled
   gTestBrowser.removeEventListener("load", test2A, true);
   gTestBrowser.addEventListener("load", test2B, true);
 
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 2A!");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 2A!");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   // Disable Mixed Content Protection for the page (and reload)
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
-  notification.remove();
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
 }
 
 function test2B() {
   var expected = "Mixed Content Blocker disabled";
   waitForCondition(
     function() content.document.getElementById('mctestdiv').innerHTML == expected,
     test2C, "Error: Waited too long for mixed script to run in Test 2B");
 }
@@ -141,23 +131,19 @@ function test2C() {
   // reload the page using the provided link in the html file
   var mctestlink = content.document.getElementById("mctestlink");
   mctestlink.click();
 }
 
 function test2D() {
   gTestBrowser.removeEventListener("load", test2D, true);
 
-  // The Doorhanger should appear but isMixedContentBlocked should be NOT true,
+  // The Control Center button should appear but isMixedContentBlocked should be NOT true,
   // because our decision of disabling the mixed content blocker is persistent.
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test2D!");
-  notification.reshow();
-  ok(!PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is NOT being blocked");
-  notification.remove();
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
 
   var actual = content.document.getElementById('mctestdiv').innerHTML;
   is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 2D");
 
   // move on to Test 3
   test3();
 }
 
@@ -169,21 +155,17 @@ function test3() {
   gTestBrowser.contentWindow.location = url;
 }
 
 function test3A() {
   // Removing EventListener because we have to register a new
   // one once the page is loaded with mixed content blocker disabled
   gTestBrowser.removeEventListener("load", test3A, true);
 
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 3A!");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 3A");
-  notification.remove();
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   // We are done with tests, clean up
   cleanUpAfterTests();
 }
 
 //------------------------------------------------------
 
 function test() {
--- a/browser/base/content/test/general/browser_bug906190.js
+++ b/browser/base/content/test/general/browser_bug906190.js
@@ -138,25 +138,21 @@ function waitForSomeTabToLoad(callback) 
       callback();
     }
   }, true);
 }
 
 function checkPopUpNotification() {
   waitForSomeTabToLoad(reloadedTabAfterDisablingMCB);
 
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in " + curTestName + "!");
-  promiseNotificationShown(notification).then(function() {
-    ok(gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in " + curTestName + "!");
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
-    // Disable Mixed Content Protection for the page (and reload page)
-    gTestWin.PopupNotifications.panel.firstChild.disableMixedContentProtection();
-    notification.remove();
-  });
+  // Disable Mixed Content Protection for the page (which reloads the page)
+  let {gIdentityHandler} = gTestWin.gBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
 }
 
 function reloadedTabAfterDisablingMCB() {
   var expected = "Mixed Content Blocker disabled";
   waitForCondition(
     function() gTestWin.content.document.getElementById('mctestdiv').innerHTML == expected,
     makeSureMCBisDisabled, "Error: Waited too long for mixed script to run in " + curTestName + "!");
 }
@@ -187,28 +183,23 @@ function test1() {
   EventUtils.synthesizeMouseAtCenter(targetElt, { button: 1 }, gTestWin.content);
 }
 
 function test1A() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear but isMixedContentBlocked should be >> NOT << true,
   // because our decision of disabling the mixed content blocker is persistent across tabs.
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 1A!");
-  promiseNotificationShown(notification).then(function() {
-    ok(!gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is NOT being blocked in Test 1A!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1A");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1A");
 
-    gTestWin.gBrowser.removeCurrentTab();
-    test1B();
-  });
+  gTestWin.gBrowser.removeCurrentTab();
+  test1B();
 }
 
 function test1B() {
   curContextMenu = function (e) { contextMenuOpenHandler(e, test1C) };
   gTestWin.document.addEventListener("popupshown", curContextMenu, false);
 
   // simulating |RIGHT-CLICK -> OPEN LINK IN TAB|
   let targetElt = gTestWin.content.document.getElementById("Test1");
@@ -216,33 +207,28 @@ function test1B() {
   EventUtils.synthesizeMouseAtCenter(targetElt, { type : "contextmenu", button : 2 } , gTestWin.content);
 }
 
 function test1C() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear but isMixedContentBlocked should be >> NOT << true,
   // because our decision of disabling the mixed content blocker is persistent across tabs.
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 1C!");
-  promiseNotificationShown(notification).then(function() {
-    ok(!gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is NOT being blocked in Test 1C!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1C");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1C");
 
-    // remove tabs
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
-    gTestWin.gBrowser.selectTabAtIndex(0);
+  // remove tabs
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
+  gTestWin.gBrowser.selectTabAtIndex(0);
 
-    var childTabLink = gHttpTestRoot2 + "file_bug906190_2.html";
-    setUpTest("Test2", "linkForTest2", test2, childTabLink);
-  });
+  var childTabLink = gHttpTestRoot2 + "file_bug906190_2.html";
+  setUpTest("Test2", "linkForTest2", test2, childTabLink);
 }
 
 //------------------------ Test 2 ------------------------------
 
 function test2() {
   curClickHandler = function (e) { clickHandler(e, test2A) };
   gTestWin.gBrowser.addEventListener("click", curClickHandler, true);
 
@@ -251,28 +237,23 @@ function test2() {
   EventUtils.synthesizeMouseAtCenter(targetElt, { button: 1 }, gTestWin.content);
 }
 
 function test2A() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear and isMixedContentBlocked should be >> TRUE <<,
   // because our decision of disabling the mixed content blocker should only persist if pages are from the same domain.
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 2A!");
-  promiseNotificationShown(notification).then(function() {
-    ok(gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 2A!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 2A");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 2A");
 
-    gTestWin.gBrowser.removeCurrentTab();
-    test2B();
-  });
+  gTestWin.gBrowser.removeCurrentTab();
+  test2B();
 }
 
 function test2B() {
   curContextMenu = function (e) { contextMenuOpenHandler(e, test2C) };
   gTestWin.document.addEventListener("popupshown", curContextMenu, false);
 
   // simulating |RIGHT-CLICK -> OPEN LINK IN TAB|
   let targetElt = gTestWin.content.document.getElementById("Test2");
@@ -280,34 +261,29 @@ function test2B() {
   EventUtils.synthesizeMouseAtCenter(targetElt, { type : "contextmenu", button : 2 } , gTestWin.content);
 }
 
 function test2C() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear and isMixedContentBlocked should be >> TRUE <<,
   // because our decision of disabling the mixed content blocker should only persist if pages are from the same domain.
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 2C!");
-  promiseNotificationShown(notification).then(function() {
-    ok(gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 2C!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 2C");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 2C");
 
-    // remove tabs
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
-    gTestWin.gBrowser.selectTabAtIndex(0);
+  // remove tabs
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
+  gTestWin.gBrowser.selectTabAtIndex(0);
 
-    // file_bug906190_3_4.html redirects to page test1.example.com/* using meta-refresh
-    var childTabLink = gHttpTestRoot1 + "file_bug906190_3_4.html";
-    setUpTest("Test3", "linkForTest3", test3, childTabLink);
-  });
+  // file_bug906190_3_4.html redirects to page test1.example.com/* using meta-refresh
+  var childTabLink = gHttpTestRoot1 + "file_bug906190_3_4.html";
+  setUpTest("Test3", "linkForTest3", test3, childTabLink);
 }
 
 //------------------------ Test 3 ------------------------------
 
 function test3() {
   curClickHandler = function (e) { clickHandler(e, test3A) };
   gTestWin.gBrowser.addEventListener("click", curClickHandler, true);
   // simulating |CTRL-CLICK|
@@ -319,29 +295,24 @@ function test3A() {
   // we need this indirection because the page is reloaded caused by meta-refresh
   waitForSomeTabToLoad(test3B);
 }
 
 function test3B() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear but isMixedContentBlocked should be >> NOT << true!
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 3B!");
-  promiseNotificationShown(notification).then(function() {
-    ok(!gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is NOT being blocked in Test 3B!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 3B");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 3B");
 
-    // remove tabs
-    gTestWin.gBrowser.removeCurrentTab();
-    test3C();
-  });
+  // remove tabs
+  gTestWin.gBrowser.removeCurrentTab();
+  test3C();
 }
 
 function test3C() {
   curContextMenu = function (e) { contextMenuOpenHandler(e, test3D) };
   gTestWin.document.addEventListener("popupshown", curContextMenu, false);
 
   // simulating |RIGHT-CLICK -> OPEN LINK IN TAB|
   let targetElt = gTestWin.content.document.getElementById("Test3");
@@ -352,33 +323,28 @@ function test3D() {
   // we need this indirection because the page is reloaded caused by meta-refresh
   waitForSomeTabToLoad(test3E);
 }
 
 function test3E() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear but isMixedContentBlocked should be >> NOT << true!
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 3E!");
-  promiseNotificationShown(notification).then(function() {
-    ok(!gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is NOT being blocked in Test 3E!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 3E");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 3E");
 
-    // remove tabs
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
-    gTestWin.gBrowser.selectTabAtIndex(0);
+  // remove tabs
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
+  gTestWin.gBrowser.selectTabAtIndex(0);
 
-    var childTabLink = gHttpTestRoot1 + "file_bug906190_3_4.html";
-    setUpTest("Test4", "linkForTest4", test4, childTabLink);
-  });
+  var childTabLink = gHttpTestRoot1 + "file_bug906190_3_4.html";
+  setUpTest("Test4", "linkForTest4", test4, childTabLink);
 }
 
 //------------------------ Test 4 ------------------------------
 
 function test4() {
   curClickHandler = function (e) { clickHandler(e, test4A) };
   gTestWin.gBrowser.addEventListener("click", curClickHandler, true);
 
@@ -391,29 +357,24 @@ function test4A() {
   // we need this indirection because the page is reloaded caused by meta-refresh
   waitForSomeTabToLoad(test4B);
 }
 
 function test4B() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear and isMixedContentBlocked should be >> TRUE <<
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 4B!");
-  promiseNotificationShown(notification).then(function() {
-    ok(gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 4B!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 4B");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 4B");
 
-    // remove tabs
-    gTestWin.gBrowser.removeCurrentTab();
-    test4C();
-  });
+  // remove tabs
+  gTestWin.gBrowser.removeCurrentTab();
+  test4C();
 }
 
 function test4C() {
   curContextMenu = function (e) { contextMenuOpenHandler(e, test4D) };
   gTestWin.document.addEventListener("popupshown", curContextMenu, false);
 
   // simulating |RIGHT-CLICK -> OPEN LINK IN TAB|
   let targetElt = gTestWin.content.document.getElementById("Test4");
@@ -424,34 +385,29 @@ function test4D() {
   // we need this indirection because the page is reloaded caused by meta-refresh
   waitForSomeTabToLoad(test4E);
 }
 
 function test4E() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear and isMixedContentBlocked should be >> TRUE <<
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 4E!");
-  promiseNotificationShown(notification).then(function() {
-    ok(gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 4E!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 4E");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 4E");
 
-    // remove tabs
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
-    gTestWin.gBrowser.selectTabAtIndex(0);
+  // remove tabs
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
+  gTestWin.gBrowser.selectTabAtIndex(0);
 
-    // the sjs files returns a 302 redirect- note, same origins
-    var childTabLink = gHttpTestRoot1 + "file_bug906190.sjs";
-    setUpTest("Test5", "linkForTest5", test5, childTabLink);
-  });
+  // the sjs files returns a 302 redirect- note, same origins
+  var childTabLink = gHttpTestRoot1 + "file_bug906190.sjs";
+  setUpTest("Test5", "linkForTest5", test5, childTabLink);
 }
 
 //------------------------ Test 5 ------------------------------
 
 function test5() {
   curClickHandler = function (e) { clickHandler(e, test5A) };
   gTestWin.gBrowser.addEventListener("click", curClickHandler, true);
 
@@ -460,64 +416,57 @@ function test5() {
   EventUtils.synthesizeMouseAtCenter(targetElt, { button: 1 }, gTestWin.content);
 }
 
 function test5A() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear but isMixedContentBlocked should be >> NOT << true
   // Currently it is >> TRUE << - see follow up bug 914860
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 5A!");
-  promiseNotificationShown(notification).then(function() {
-    todo(!gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is NOT being blocked in Test 5A!");
-    notification.remove();
+  let {gIdentityHandler} = gTestWin.gBrowser.ownerGlobal;
+  todo(!gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"), "OK: Mixed Content is NOT being blocked in Test 5A!");
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    todo_is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 5A!");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  todo_is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 5A!");
 
-    // remove tabs
-    gTestWin.gBrowser.removeCurrentTab();
-    test5B();
-  });
+  // remove tabs
+  gTestWin.gBrowser.removeCurrentTab();
+  test5B();
 }
 
 function test5B() {
   curContextMenu = function (e) { contextMenuOpenHandler(e, test5C) };
   gTestWin.document.addEventListener("popupshown", curContextMenu, false);
 
   // simulating |RIGHT-CLICK -> OPEN LINK IN TAB|
   let targetElt = gTestWin.content.document.getElementById("Test5");
   EventUtils.synthesizeMouseAtCenter(targetElt, { type : "contextmenu", button : 2 } , gTestWin.content);
 }
 
 function test5C() {
   // move the tab again
   gTestWin.gBrowser.selectTabAtIndex(2);
 
+  let {gIdentityHandler} = gTestWin.gBrowser.ownerGlobal;
+
   // The Doorhanger should appear but isMixedContentBlocked should be >> NOT << true
   // Currently it is >> TRUE << - see follow up bug 914860
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 5C!");
-  promiseNotificationShown(notification).then(function() {
-    todo(!gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is NOT being blocked in Test 5C!");
-    notification.remove();
+  todo(!gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"), "OK: Mixed Content is NOT being blocked in Test 5C!");
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    todo_is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 5C!");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  todo_is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 5C!");
 
-    // remove tabs
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
-    gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
-    gTestWin.gBrowser.selectTabAtIndex(0);
+  // remove tabs
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[2], {animate: false});
+  gTestWin.gBrowser.removeTab(gTestWin.gBrowser.tabs[1], {animate: false});
+  gTestWin.gBrowser.selectTabAtIndex(0);
 
-    // the sjs files returns a 302 redirect - note, different origins
-    var childTabLink = gHttpTestRoot2 + "file_bug906190.sjs";
-    setUpTest("Test6", "linkForTest6", test6, childTabLink);
-  });
+  // the sjs files returns a 302 redirect - note, different origins
+  var childTabLink = gHttpTestRoot2 + "file_bug906190.sjs";
+  setUpTest("Test6", "linkForTest6", test6, childTabLink);
 }
 
 //------------------------ Test 6 ------------------------------
 
 function test6() {
   curClickHandler = function (e) { clickHandler(e, test6A) };
   gTestWin.gBrowser.addEventListener("click", curClickHandler, true);
 
@@ -525,56 +474,46 @@ function test6() {
   let targetElt = gTestWin.content.document.getElementById("Test6");
   EventUtils.synthesizeMouseAtCenter(targetElt, { button: 1 }, gTestWin.content);
 }
 
 function test6A() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear and isMixedContentBlocked should be >> TRUE <<
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 6A!");
-  promiseNotificationShown(notification).then(function() {
-    ok(gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 6A!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 6A");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 6A");
 
-    // done
-    gTestWin.gBrowser.removeCurrentTab();
-    test6B();
-  });
+  // done
+  gTestWin.gBrowser.removeCurrentTab();
+  test6B();
 }
 
 function test6B() {
   curContextMenu = function (e) { contextMenuOpenHandler(e, test6C) };
   gTestWin.document.addEventListener("popupshown", curContextMenu, false);
 
   // simulating |RIGHT-CLICK -> OPEN LINK IN TAB|
   let targetElt = gTestWin.content.document.getElementById("Test6");
   EventUtils.synthesizeMouseAtCenter(targetElt, { type : "contextmenu", button : 2 } , gTestWin.content);
 }
 
 function test6C() {
   gTestWin.gBrowser.selectTabAtIndex(2);
 
   // The Doorhanger should appear and isMixedContentBlocked should be >> TRUE <<
-  var notification = PopupNotifications.getNotification("bad-content", gTestWin.gBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger did appear in Test 6C!");
-  promiseNotificationShown(notification).then(function() {
-    ok(gTestWin.PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked in Test 6C!");
-    notification.remove();
+  assertMixedContentBlockingState(gTestWin.gBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
-    var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
-    is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 6C");
+  var actual = gTestWin.content.document.getElementById('mctestdiv').innerHTML;
+  is(actual, "Mixed Content Blocker enabled", "OK: Blocked mixed script in Test 6C");
 
-    gTestWin.close();
-    finish();
-  });
+  gTestWin.close();
+  finish();
 }
 
 //------------------------ SETUP ------------------------------
 
 function setupTestBrowserWindow() {
   // Inject links in content.
   let doc = gTestWin.content.document;
   let mainDiv = doc.createElement("div");
--- a/browser/base/content/test/general/browser_mcb_redirect.js
+++ b/browser/base/content/test/general/browser_mcb_redirect.js
@@ -95,47 +95,45 @@ function waitForCondition(condition, nex
   var moveOn = function() {
     clearInterval(interval); nextTest();
   };
 }
 
 //------------------------ Test 1 ------------------------------
 
 function test1() {
-  gTestBrowser.addEventListener("load", checkPopUpNotificationsForTest1, true);
+  gTestBrowser.addEventListener("load", checkUIForTest1, true);
   var url = gHttpsTestRoot + "test_mcb_redirect.html"
   gTestBrowser.contentWindow.location = url;
 }
 
-function checkPopUpNotificationsForTest1() {
-  gTestBrowser.removeEventListener("load", checkPopUpNotificationsForTest1, true);
+function checkUIForTest1() {
+  gTestBrowser.removeEventListener("load", checkUIForTest1, true);
 
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser.selectedBrowser);
-  ok(notification, "OK: Mixed Content Doorhanger appeared in Test1!");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
   var expected = "script blocked";
   waitForCondition(
     function() content.document.getElementById('mctestdiv').innerHTML == expected,
     test2, "Error: Waited too long for status in Test 1!",
     "OK: Expected result in innerHTML for Test1!");
 }
 
 //------------------------ Test 2 ------------------------------
 
 function test2() {
-  gTestBrowser.addEventListener("load", checkPopUpNotificationsForTest2, true);
+  gTestBrowser.addEventListener("load", checkUIForTest2, true);
   var url = gHttpTestRoot + "test_mcb_redirect.html"
   gTestBrowser.contentWindow.location = url;
 }
 
-function checkPopUpNotificationsForTest2() {
-  gTestBrowser.removeEventListener("load", checkPopUpNotificationsForTest2, true);
+function checkUIForTest2() {
+  gTestBrowser.removeEventListener("load", checkUIForTest2, true);
 
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser.selectedBrowser);
-  ok(!notification, "OK: Mixed Content Doorhanger did not appear in 2!");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: false, passiveLoaded: false});
 
   var expected = "script executed";
   waitForCondition(
     function() content.document.getElementById('mctestdiv').innerHTML == expected,
     test3, "Error: Waited too long for status in Test 2!",
     "OK: Expected result in innerHTML for Test2!");
 }
 
--- a/browser/base/content/test/general/browser_mixedcontent_securityflags.js
+++ b/browser/base/content/test/general/browser_mixedcontent_securityflags.js
@@ -34,41 +34,32 @@ function blockMixedContentTest()
     overrideMCB();
   }, true);
 }
 
 function overrideMCB()
 {
   // test mixed content flags on load (reload)
   gTestBrowser.addEventListener("load", mixedContentOverrideTest, true);
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "Mixed Content Doorhanger should appear");
-  notification.reshow();
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked, "OK: Mixed Content is being blocked");
+
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
 
-  // Make sure the notification has no mixedblockdisabled attribute
-  ok(!PopupNotifications.panel.firstChild.hasAttribute("mixedblockdisabled"),
-    "Doorhanger must have no mixedblockdisabled attribute");
   // Click on the doorhanger to allow mixed content (and reload page)
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  gIdentityHandler.disableMixedContentProtection();
+
   notification.remove();
 }
 
 function mixedContentOverrideTest()
 {
   gTestBrowser.removeEventListener("load", mixedContentOverrideTest, true);
 
   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");
 
-  let notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(notification, "Mixed Content Doorhanger should appear");
-  notification.reshow();
-
-  // Make sure the notification has the mixedblockdisabled attribute set to true
-  is(PopupNotifications.panel.firstChild.getAttribute("mixedblockdisabled"), "true",
-    "Doorhanger must have [mixedblockdisabled='true'] attribute");
+  assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: true});
 
   gBrowser.removeCurrentTab();
   finish();
 }
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -753,16 +753,76 @@ function assertWebRTCIndicatorStatus(exp
            item + " global indicator attribute as expected");
       }
 
       ok(!indicator.hasMoreElements(), "only one global indicator window");
     }
   }
 }
 
+/**
+ * Test the state of the identity box and control center to make
+ * sure they are correctly showing the expected mixed content states.
+ *
+ * @param tabbrowser
+ * @param Object states
+ *        MUST include the following properties:
+ *        {
+ *           activeLoaded: true|false,
+ *           activeBlocked: true|false,
+ *           passiveLoaded: true|false,
+ *        }
+ */
+function assertMixedContentBlockingState(tabbrowser, states = {}) {
+  if (!tabbrowser || !("activeLoaded" in states) ||
+      !("activeBlocked" in states) || !("passiveLoaded" in states))  {
+    throw new Error("assertMixedContentBlockingState requires a browser and a states object");
+  }
+
+  let {passiveLoaded,activeLoaded,activeBlocked} = states;
+  let {gIdentityHandler} = tabbrowser.ownerGlobal;
+  let doc = tabbrowser.ownerDocument;
+  let identityBox = gIdentityHandler._identityBox;
+  let classList = identityBox.classList;
+
+  // Make sure the identity box UI has the correct mixedcontent states
+  is(classList.contains("mixedActiveContent"), activeLoaded,
+      "identityBox has expected class for activeLoaded");
+  is(classList.contains("mixedActiveBlocked"), activeBlocked && !passiveLoaded,
+      "identityBox has expected class for activeBlocked && !passiveLoaded");
+  is(classList.contains("mixedDisplayContent"), passiveLoaded && !activeLoaded,
+     "identityBox has expected class for passiveLoaded && activeLoaded");
+  is(classList.contains("mixedDisplayContentLoadedActiveBlocked"), passiveLoaded && activeBlocked,
+     "identityBox has expected class for passiveLoaded && activeBlocked");
+  is (classList.contains("mixedContent"), activeBlocked || activeLoaded || passiveLoaded,
+     "identityBox is showing no mixed content");
+
+  // Make sure the identity popup has the correct mixedcontent states
+  gIdentityHandler._identityBox.click();
+  let popupAttr = doc.getElementById("identity-popup").getAttribute("mixedcontent");
+  let bodyAttr = doc.getElementById("identity-popup-securityView-body").getAttribute("mixedcontent");
+
+  is(popupAttr.contains("active-loaded"), activeLoaded,
+      "identity-popup has expected attr for activeLoaded");
+  is(bodyAttr.contains("active-loaded"), activeLoaded,
+      "securityView-body has expected attr for activeLoaded");
+
+  is(popupAttr.contains("active-blocked"), activeBlocked,
+      "identity-popup has expected attr for activeBlocked");
+  is(bodyAttr.contains("active-blocked"), activeBlocked,
+      "securityView-body has expected attr for activeBlocked");
+
+  is(popupAttr.contains("passive-loaded"), passiveLoaded,
+      "identity-popup has expected attr for passiveLoaded");
+  is(bodyAttr.contains("passive-loaded"), passiveLoaded,
+      "securityView-body has expected attr for passiveLoaded");
+
+  gIdentityHandler._identityPopup.hidden = true;
+}
+
 function makeActionURI(action, params) {
   let url = "moz-action:" + action + "," + JSON.stringify(params);
   return NetUtil.newURI(url);
 }
 
 function is_hidden(element) {
   var style = element.ownerDocument.defaultView.getComputedStyle(element, "");
   if (style.display == "none")
--- a/browser/devtools/webconsole/test/browser.ini
+++ b/browser/devtools/webconsole/test/browser.ini
@@ -192,20 +192,22 @@ skip-if = e10s # Bug 1042253 - webconsol
 [browser_output_breaks_after_console_dir_uninspectable.js]
 [browser_output_longstring_expand.js]
 [browser_repeated_messages_accuracy.js]
 skip-if = buildapp == 'mulet'
 [browser_result_format_as_string.js]
 [browser_warn_user_about_replaced_api.js]
 [browser_webconsole_abbreviate_source_url.js]
 [browser_webconsole_allow_mixedcontent_securityerrors.js]
+tags = mcb
 skip-if = buildapp == 'mulet'
 [browser_webconsole_assert.js]
 [browser_webconsole_basic_net_logging.js]
 [browser_webconsole_block_mixedcontent_securityerrors.js]
+tags = mcb
 skip-if = buildapp == 'mulet'
 [browser_webconsole_bug_579412_input_focus.js]
 [browser_webconsole_bug_580001_closing_after_completion.js]
 [browser_webconsole_bug_580030_errors_after_page_reload.js]
 skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s (expectUncaughtException)
 [browser_webconsole_bug_580454_timestamp_l10n.js]
 [browser_webconsole_bug_582201_duplicate_errors.js]
 skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s (expectUncaughtException)
--- a/browser/devtools/webconsole/test/browser_webconsole_block_mixedcontent_securityerrors.js
+++ b/browser/devtools/webconsole/test/browser_webconsole_block_mixedcontent_securityerrors.js
@@ -58,44 +58,22 @@ function pushPrefEnv() {
   let options = {"set": [
                   ["security.mixed_content.block_active_content", true],
                   ["security.mixed_content.block_display_content", true]
                 ]};
   SpecialPowers.pushPrefEnv(options, deferred.resolve);
   return deferred.promise;
 }
 
-function waitForNotificationShown(notification, callback) {
-  if (PopupNotifications.panel.state == "open") {
-    executeSoon(callback);
-    return;
-  }
-  PopupNotifications.panel.addEventListener("popupshown", function onShown() {
-    PopupNotifications.panel.removeEventListener("popupshown", onShown);
-    callback();
-  }, false);
-  notification.reshow();
-}
-
 function mixedContentOverrideTest2(hud, browser) {
-  let notification = PopupNotifications.getNotification("bad-content", browser);
-  ok(notification, "Mixed Content Doorhanger did appear");
   let deferred = promise.defer();
-  waitForNotificationShown(notification, () => {
-    afterNotificationShown(hud, notification, deferred);
-  });
-  return deferred.promise;
-}
-
-function afterNotificationShown(hud, notification, deferred) {
-  ok(PopupNotifications.panel.firstChild.isMixedContentBlocked,
-     "OK: Mixed Content is being blocked");
-  // Click on the doorhanger.
-  PopupNotifications.panel.firstChild.disableMixedContentProtection();
-  notification.remove();
+  let {gIdentityHandler} = browser.ownerGlobal;
+  ok(gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"),
+    "Mixed Active Content state appeared on identity box");
+  gIdentityHandler.disableMixedContentProtection();
 
   waitForMessages({
     webconsole: hud,
     messages: [
       {
         name: "Logged blocking mixed active content",
         text: "Loading mixed (insecure) active content " +
               "\"http://example.com/\" on a secure page",
@@ -109,16 +87,18 @@ function afterNotificationShown(hud, not
           " \"http://example.com/tests/image/test/mochitest/blue.png\"" +
           " on a secure page",
         category: CATEGORY_SECURITY,
         severity: SEVERITY_WARNING,
         objects: true,
       },
     ],
   }).then(msgs => deferred.resolve(msgs), Cu.reportError);
+
+  return deferred.promise;
 }
 
 function testClickOpenNewTab(hud, match) {
   let warningNode = match.clickableElements[0];
   ok(warningNode, "link element");
   ok(warningNode.classList.contains("learn-more-link"), "link class name");
   return simulateMessageLinkClick(warningNode, LEARN_MORE_URI);
 }
--- a/dom/base/test/browser.ini
+++ b/dom/base/test/browser.ini
@@ -1,15 +1,16 @@
 [DEFAULT]
 support-files =
   file_messagemanager_unload.html
 
 [browser_bug593387.js]
 skip-if = e10s # Bug ?????? - test directly touches content (contentWindow.iframe.addEventListener)
 [browser_bug902350.js]
+tags = mcb
 skip-if = e10s # Bug ?????? - test e10s utils don't support load events from iframe etc, which this test relies on.
 [browser_messagemanager_loadprocessscript.js]
 [browser_messagemanager_targetframeloader.js]
 [browser_pagehide_on_tab_close.js]
 skip-if = e10s # this tests non-e10s behavior. it's not expected to work in e10s.
 [browser_messagemanager_unload.js]
 [browser_state_notifications.js]
 # skip-if = e10s # Bug ?????? - content-document-* notifications come while document's URI is still about:blank, but test expects real URL.
--- a/dom/base/test/browser_bug902350.js
+++ b/dom/base/test/browser_bug902350.js
@@ -46,18 +46,19 @@ function MixedTest1A() {
 function MixedTest1B() {
   gTestBrowser.removeEventListener("load", MixedTest1B, true);
   gTestBrowser.addEventListener("load", MixedTest1C, true);
   var frame = content.document.getElementById("testing_frame");
   var topTarget = frame.contentWindow.document.getElementById("topTarget");
   topTarget.click();
 
   // The link click should have caused a load and should not invoke the Mixed Content Blocker
-  var notification = PopupNotifications.getNotification("bad-content", gTestBrowser);
-  ok(!notification, "Mixed Content Doorhanger did not appear when trying to navigate top");
+  let {gIdentityHandler} = gTestBrowser.ownerGlobal;
+  ok (!gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"),
+      "Mixed Content Doorhanger did not appear when trying to navigate top");
 }
 
 function MixedTest1C() {
   gTestBrowser.removeEventListener("load", MixedTest1C, true);
   ok(gTestBrowser.contentWindow.location == "http://example.com/", "Navigating to insecure domain through target='_top' failed.")
   MixedTestsCompleted();
 }