summaryrefslogtreecommitdiffstats
path: root/toolkit/components/aboutconfig/test/browser/browser_warning.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /toolkit/components/aboutconfig/test/browser/browser_warning.js
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/aboutconfig/test/browser/browser_warning.js')
-rw-r--r--toolkit/components/aboutconfig/test/browser/browser_warning.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/toolkit/components/aboutconfig/test/browser/browser_warning.js b/toolkit/components/aboutconfig/test/browser/browser_warning.js
new file mode 100644
index 0000000000..f199d3e939
--- /dev/null
+++ b/toolkit/components/aboutconfig/test/browser/browser_warning.js
@@ -0,0 +1,41 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+add_setup(async function() {
+ await SpecialPowers.pushPrefEnv({
+ set: [["browser.aboutConfig.showWarning", true]],
+ });
+});
+
+add_task(async function test_showWarningNextTime() {
+ for (let test of [
+ { expectWarningPage: true, disableShowWarningNextTime: false },
+ { expectWarningPage: true, disableShowWarningNextTime: true },
+ { expectWarningPage: false },
+ ]) {
+ await AboutConfigTest.withNewTab(
+ async function() {
+ if (test.expectWarningPage) {
+ this.assertWarningPage(true);
+ Assert.ok(
+ this.document.getElementById("showWarningNextTime").checked
+ );
+ if (test.disableShowWarningNextTime) {
+ this.document.getElementById("showWarningNextTime").click();
+ }
+ this.bypassWarningButton.click();
+ }
+
+ // No results are shown after the warning page is dismissed or bypassed.
+ this.assertWarningPage(false);
+ Assert.ok(!this.prefsTable.firstElementChild);
+ Assert.equal(this.document.activeElement, this.searchInput);
+
+ // The show all button should be present and show all results immediately.
+ this.showAll();
+ Assert.ok(this.prefsTable.firstElementChild);
+ },
+ { dontBypassWarning: true }
+ );
+ }
+});