Bug 1557725 - Ensure protections panel is enabled for tests. r=ewright
authorNihanth Subramanya <nhnt11@gmail.com>
Fri, 21 Jun 2019 19:36:27 +0000
changeset 479880 ecbdb92e03bd78086a698126f12bdd9d1c9ba4e5
parent 479879 72e37cf732494475ea24f66f2f10c1d1594ed494
child 479881 bfee60ff0a54cadfdedd541a8607a56fd1959df2
push id36188
push usernerli@mozilla.com
push dateSun, 23 Jun 2019 09:42:01 +0000
treeherdermozilla-central@bfee60ff0a54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersewright
bugs1557725
milestone69.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 1557725 - Ensure protections panel is enabled for tests. r=ewright Differential Revision: https://phabricator.services.mozilla.com/D35437
browser/base/content/test/siteProtections/browser_protections_UI.js
--- a/browser/base/content/test/siteProtections/browser_protections_UI.js
+++ b/browser/base/content/test/siteProtections/browser_protections_UI.js
@@ -1,13 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* Basic UI tests for the protections panel */
 
+add_task(async function setup() {
+  await SpecialPowers.pushPrefEnv({
+    set: [
+      ["browser.protections_panel.enabled", true],
+    ],
+  });
+});
+
 add_task(async function testToggleSwitch() {
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "https://example.com");
   await openProtectionsPanel();
   ok(gProtectionsHandler._protectionsPopupTPSwitch.hasAttribute("enabled"), "TP Switch should be enabled");
   let popuphiddenPromise = BrowserTestUtils.waitForEvent(protectionsPopup, "popuphidden");
   let browserLoadedPromise = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
   gProtectionsHandler._protectionsPopupTPSwitch.click();
   await popuphiddenPromise;