Bug 1516340 - Properly clean up prefs in browser_contentblocking.js. r=ewright, a=test-only
authorJohann Hofmann <jhofmann@mozilla.com>
Thu, 10 Jan 2019 14:46:00 +0000
changeset 506613 45c1f862dccf624e4986335886135cd2282fa412
parent 506612 ec8b117733714c03f025167c0ef22c358053597a
child 506614 a89c8727eb57a4d7bf449315b0d9c05d2975ddb2
push id10482
push userryanvm@gmail.com
push dateThu, 10 Jan 2019 17:30:03 +0000
treeherdermozilla-beta@c4bda79261ba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersewright, test-only
bugs1516340
milestone65.0
Bug 1516340 - Properly clean up prefs in browser_contentblocking.js. r=ewright, a=test-only Differential Revision: https://phabricator.services.mozilla.com/D16030
browser/components/preferences/in-content/tests/browser_contentblocking.js
--- a/browser/components/preferences/in-content/tests/browser_contentblocking.js
+++ b/browser/components/preferences/in-content/tests/browser_contentblocking.js
@@ -247,16 +247,20 @@ add_task(async function testContentBlock
   default:
     ok(false, "Unexpected default value found for " + NCB_PREF + ": " + defaultNCB);
     break;
   }
   Services.prefs.setIntPref(NCB_PREF, nonDefaultNCB);
   await TestUtils.waitForCondition(() => Services.prefs.prefHasUserValue(NCB_PREF));
   is(Services.prefs.getStringPref(CAT_PREF), "custom", `${CAT_PREF} has been set to custom`);
 
+  for (let pref of prefs) {
+    SpecialPowers.clearUserPref(pref);
+  }
+
   gBrowser.removeCurrentTab();
 });
 
 function checkControlState(doc, controls, enabled) {
   for (let selector of controls) {
     for (let control of doc.querySelectorAll(selector)) {
       if (enabled) {
         ok(!control.hasAttribute("disabled"), `${selector} is enabled.`);