summaryrefslogtreecommitdiffstats
path: root/browser/components/preferences/tests/browser_bug1579418.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /browser/components/preferences/tests/browser_bug1579418.js
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/preferences/tests/browser_bug1579418.js')
-rw-r--r--browser/components/preferences/tests/browser_bug1579418.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/browser/components/preferences/tests/browser_bug1579418.js b/browser/components/preferences/tests/browser_bug1579418.js
new file mode 100644
index 0000000000..a179ae9936
--- /dev/null
+++ b/browser/components/preferences/tests/browser_bug1579418.js
@@ -0,0 +1,55 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+add_task(async function default_homepage_test() {
+ let oldHomepagePref = Services.prefs.getCharPref("browser.startup.homepage");
+ let oldStartpagePref = Services.prefs.getIntPref("browser.startup.page");
+
+ await openPreferencesViaOpenPreferencesAPI("paneHome", { leaveOpen: true });
+
+ let doc = gBrowser.contentDocument;
+ let homeMode = doc.getElementById("homeMode");
+ let customSettings = doc.getElementById("customSettings");
+
+ // HOME_MODE_FIREFOX_HOME
+ homeMode.value = 0;
+
+ homeMode.dispatchEvent(new Event("command"));
+
+ is(Services.prefs.getCharPref("browser.startup.homepage"), "about:home");
+
+ // HOME_MODE_BLANK
+ homeMode.value = 1;
+
+ homeMode.dispatchEvent(new Event("command"));
+
+ await TestUtils.waitForCondition(
+ () => customSettings.hidden === true,
+ "Wait for customSettings to be hidden."
+ );
+
+ is(
+ Services.prefs.getCharPref("browser.startup.homepage"),
+ "chrome://browser/content/blanktab.html"
+ );
+
+ // HOME_MODE_CUSTOM
+ homeMode.value = 2;
+
+ homeMode.dispatchEvent(new Event("command"));
+
+ await TestUtils.waitForCondition(
+ () => customSettings.hidden === false,
+ "Wait for customSettings to be shown."
+ );
+
+ is(customSettings.hidden, false, "homePageURL should be visible");
+
+ registerCleanupFunction(async () => {
+ Services.prefs.setCharPref("browser.startup.homepage", oldHomepagePref);
+ Services.prefs.setIntPref("browser.startup.page", oldStartpagePref);
+ BrowserTestUtils.removeTab(gBrowser.selectedTab);
+ });
+});