summaryrefslogtreecommitdiffstats
path: root/browser/components/preferences/tests/browser_homepages_filter_aboutpreferences.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/components/preferences/tests/browser_homepages_filter_aboutpreferences.js')
-rw-r--r--browser/components/preferences/tests/browser_homepages_filter_aboutpreferences.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/browser/components/preferences/tests/browser_homepages_filter_aboutpreferences.js b/browser/components/preferences/tests/browser_homepages_filter_aboutpreferences.js
new file mode 100644
index 0000000000..f54d0edaaa
--- /dev/null
+++ b/browser/components/preferences/tests/browser_homepages_filter_aboutpreferences.js
@@ -0,0 +1,33 @@
+add_task(async function testSetHomepageUseCurrent() {
+ is(
+ gBrowser.currentURI.spec,
+ "about:blank",
+ "Test starts with about:blank open"
+ );
+ await BrowserTestUtils.openNewForegroundTab(gBrowser, "about:home");
+ await openPreferencesViaOpenPreferencesAPI("paneHome", { leaveOpen: true });
+ let doc = gBrowser.contentDocument;
+ is(
+ gBrowser.currentURI.spec,
+ "about:preferences#home",
+ "#home should be in the URI for about:preferences"
+ );
+ let oldHomepage = HomePage.get();
+
+ let useCurrent = doc.getElementById("useCurrentBtn");
+ useCurrent.click();
+
+ is(gBrowser.tabs.length, 3, "Three tabs should be open");
+ await TestUtils.waitForCondition(
+ () => HomePage.get() == "about:blank|about:home"
+ );
+ is(
+ HomePage.get(),
+ "about:blank|about:home",
+ "about:blank and about:home should be the only homepages set"
+ );
+
+ HomePage.safeSet(oldHomepage);
+ BrowserTestUtils.removeTab(gBrowser.selectedTab);
+ BrowserTestUtils.removeTab(gBrowser.selectedTab);
+});