summaryrefslogtreecommitdiffstats
path: root/browser/components/preferences/tests/browser_password_management.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 /browser/components/preferences/tests/browser_password_management.js
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/preferences/tests/browser_password_management.js')
-rw-r--r--browser/components/preferences/tests/browser_password_management.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/browser/components/preferences/tests/browser_password_management.js b/browser/components/preferences/tests/browser_password_management.js
new file mode 100644
index 0000000000..c5d5ff613d
--- /dev/null
+++ b/browser/components/preferences/tests/browser_password_management.js
@@ -0,0 +1,43 @@
+"use strict";
+
+const { LoginTestUtils } = ChromeUtils.import(
+ "resource://testing-common/LoginTestUtils.jsm"
+);
+const { TelemetryTestUtils } = ChromeUtils.importESModule(
+ "resource://testing-common/TelemetryTestUtils.sys.mjs"
+);
+
+var passwordsDialog;
+
+add_task(async function test_openPasswordManagement() {
+ await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true });
+
+ let tabOpenPromise = BrowserTestUtils.waitForNewTab(gBrowser, "about:logins");
+
+ await SpecialPowers.spawn(gBrowser.selectedBrowser, [], function() {
+ let doc = content.document;
+
+ let savePasswordCheckBox = doc.getElementById("savePasswords");
+ Assert.ok(
+ !savePasswordCheckBox.checked,
+ "Save Password CheckBox should be unchecked by default"
+ );
+
+ let showPasswordsButton = doc.getElementById("showPasswords");
+ showPasswordsButton.click();
+ });
+
+ let tab = await tabOpenPromise;
+ ok(tab, "Tab opened");
+
+ // check telemetry events while we are in here
+ await LoginTestUtils.telemetry.waitForEventCount(1);
+ TelemetryTestUtils.assertEvents(
+ [["pwmgr", "open_management", "preferences"]],
+ { category: "pwmgr", method: "open_management" },
+ { clear: true, process: "content" }
+ );
+
+ BrowserTestUtils.removeTab(tab);
+ gBrowser.removeCurrentTab();
+});