Bug 1307151 - Clear prefs in a cleanup function in browser_webconsole_bug_737873_mixedcontent.js;r=me draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Mon, 03 Oct 2016 08:57:43 -0700
changeset 420165 235a3a89688d73495c13a1a27b6af3fd67a6a60c
parent 420164 6619a470dcb905afc7c9c63d7e2da05c57d6964b
child 532740 6f523aa2e04f1839746b400d592c5e3e795745c3
push id31118
push userbgrinstead@mozilla.com
push dateMon, 03 Oct 2016 15:59:53 +0000
reviewersme
bugs1307151
milestone52.0a1
Bug 1307151 - Clear prefs in a cleanup function in browser_webconsole_bug_737873_mixedcontent.js;r=me MozReview-Commit-ID: If7IOgdFQBY
devtools/client/webconsole/test/browser_webconsole_bug_737873_mixedcontent.js
--- a/devtools/client/webconsole/test/browser_webconsole_bug_737873_mixedcontent.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_737873_mixedcontent.js
@@ -8,30 +8,32 @@
 "use strict";
 
 const TEST_URI = "data:text/html;charset=utf8,Web Console mixed content test";
 const TEST_HTTPS_URI = "https://example.com/browser/devtools/client/" +
                        "webconsole/test/test-bug-737873-mixedcontent.html";
 const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/Security/" +
                        "Mixed_content";
 
+registerCleanupFunction(function*() {
+  Services.prefs.clearUserPref("security.mixed_content.block_display_content");
+  Services.prefs.clearUserPref("security.mixed_content.block_active_content");
+});
+
 add_task(function* () {
   Services.prefs.setBoolPref("security.mixed_content.block_display_content",
                              false);
   Services.prefs.setBoolPref("security.mixed_content.block_active_content",
                              false);
 
   yield loadTab(TEST_URI);
 
   let hud = yield openConsole();
 
   yield testMixedContent(hud);
-
-  Services.prefs.clearUserPref("security.mixed_content.block_display_content");
-  Services.prefs.clearUserPref("security.mixed_content.block_active_content");
 });
 
 var testMixedContent = Task.async(function* (hud) {
   BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_HTTPS_URI);
 
   let results = yield waitForMessages({
     webconsole: hud,
     messages: [{