summaryrefslogtreecommitdiffstats
path: root/browser/components/preferences/tests/browser_search_subdialogs_within_preferences_1.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/preferences/tests/browser_search_subdialogs_within_preferences_1.js')
-rw-r--r--browser/components/preferences/tests/browser_search_subdialogs_within_preferences_1.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/browser/components/preferences/tests/browser_search_subdialogs_within_preferences_1.js b/browser/components/preferences/tests/browser_search_subdialogs_within_preferences_1.js
new file mode 100644
index 0000000000..e676de0a6c
--- /dev/null
+++ b/browser/components/preferences/tests/browser_search_subdialogs_within_preferences_1.js
@@ -0,0 +1,48 @@
+/*
+ * 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]],
+ });
+});
+
+/**
+ * Test for searching for the "Set Home Page" subdialog.
+ */
+add_task(async function () {
+ // Set custom URL so bookmark button will be shown on the page (otherwise it is hidden)
+ await SpecialPowers.pushPrefEnv({
+ set: [
+ ["browser.startup.homepage", "about:robots"],
+ ["browser.startup.page", 1],
+ ],
+ });
+
+ await openPreferencesViaOpenPreferencesAPI("paneHome", { leaveOpen: true });
+
+ // Wait for Activity Stream to add its panels
+ await BrowserTestUtils.waitForCondition(() =>
+ SpecialPowers.spawn(
+ gBrowser.selectedTab.linkedBrowser,
+ [],
+ () => !!content.document.getElementById("homeContentsGroup")
+ )
+ );
+
+ await evaluateSearchResults("Set Home Page", "homepageGroup");
+ BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});
+
+/**
+ * Test for searching for the "Languages" subdialog.
+ */
+add_task(async function () {
+ await openPreferencesViaOpenPreferencesAPI("paneGeneral", {
+ leaveOpen: true,
+ });
+ await evaluateSearchResults("Choose languages", "languagesGroup");
+ BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});