Bug 1488097 - Make browser_search_subdialogs_within_preferences_site_data.js test both the case with and without the Content Blocking UI; r=johannh
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 02 Sep 2018 18:22:12 -0400
changeset 482801 5f3c4ccdea0c3644793c9583d694745b9d175c24
parent 482800 8351581ba5a44684bdfbbcf731756cd5f785c46c
child 482816 00b25e05644117de41456318ec958d89f4421e6e
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersjohannh
bugs1488097
milestone63.0a1
Bug 1488097 - Make browser_search_subdialogs_within_preferences_site_data.js test both the case with and without the Content Blocking UI; r=johannh Differential Revision: https://phabricator.services.mozilla.com/D4828
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_site_data.js
--- a/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_site_data.js
+++ b/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_site_data.js
@@ -2,16 +2,21 @@
 * This file contains tests for the Preferences search bar.
 */
 
 // Enabling Searching functionatily. Will display search bar form this testcase forward.
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({"set": [["browser.preferences.search", true]]});
 });
 
+// First, run the tests without the Content Blocking UI.
+add_task(async function() {
+  await SpecialPowers.pushPrefEnv({"set": [["browser.contentblocking.ui.enabled", false]]});
+});
+
 /**
  * Test for searching for the "Settings - Site Data" subdialog.
  */
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   await evaluateSearchResults("cookies", ["siteDataGroup"]);
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
@@ -28,8 +33,40 @@ add_task(async function() {
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
 
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
   await evaluateSearchResults("third-party", "siteDataGroup");
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });
+
+// Now, run the tests with the Content Blocking UI.
+add_task(async function() {
+  await SpecialPowers.pushPrefEnv({"set": [["browser.contentblocking.ui.enabled", true]]});
+});
+
+/**
+ * Test for searching for the "Settings - Site Data" subdialog.
+ */
+add_task(async function() {
+  await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+  await evaluateSearchResults("cookies", ["siteDataGroup", "trackingGroup"]);
+  BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});
+
+add_task(async function() {
+  await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+  await evaluateSearchResults("site data", ["siteDataGroup"]);
+  BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});
+
+add_task(async function() {
+  await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+  await evaluateSearchResults("cache", ["siteDataGroup"]);
+  BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});
+
+add_task(async function() {
+  await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
+  await evaluateSearchResults("third-party", ["siteDataGroup", "trackingGroup"]);
+  BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});