summaryrefslogtreecommitdiffstats
path: root/toolkit/components/passwordmgr/test/unit
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /toolkit/components/passwordmgr/test/unit
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/passwordmgr/test/unit')
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_isProbablyANewPasswordField.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/toolkit/components/passwordmgr/test/unit/test_isProbablyANewPasswordField.js b/toolkit/components/passwordmgr/test/unit/test_isProbablyANewPasswordField.js
index 167c160da2..0bc88734d2 100644
--- a/toolkit/components/passwordmgr/test/unit/test_isProbablyANewPasswordField.js
+++ b/toolkit/components/passwordmgr/test/unit/test_isProbablyANewPasswordField.js
@@ -4,9 +4,10 @@
"use strict";
-const LoginAutoComplete = Cc[
- "@mozilla.org/login-manager/autocompletesearch;1"
-].getService(Ci.nsILoginAutoCompleteSearch).wrappedJSObject;
+const { LoginManagerChild } = ChromeUtils.importESModule(
+ "resource://gre/modules/LoginManagerChild.sys.mjs"
+);
+
// TODO: create a fake window for the test document to pass fathom.isVisible check.
// We should consider moving these tests to mochitest because many fathom
// signals rely on visibility, position, etc., of the test element (See Bug 1712699),
@@ -143,9 +144,10 @@ add_task(async function test_returns_false_when_pref_disabled() {
"http://localhost:8080/test/",
testcase.document
);
+ const lmc = new LoginManagerChild();
for (let [i, input] of testcase.inputs ||
document.querySelectorAll(`input[type="password"]`).entries()) {
- const result = LoginAutoComplete.isProbablyANewPasswordField(input);
+ const result = lmc.isProbablyANewPasswordField(input);
Assert.strictEqual(
result,
false,
@@ -172,10 +174,11 @@ for (let testcase of TESTCASES) {
document = makeDocumentVisibleToFathom(document);
+ const lmc = new LoginManagerChild();
const results = [];
for (let input of testcase.inputs ||
document.querySelectorAll(`input[type="password"]`)) {
- const result = LoginAutoComplete.isProbablyANewPasswordField(input);
+ const result = lmc.isProbablyANewPasswordField(input);
results.push(result);
}