summaryrefslogtreecommitdiffstats
path: root/browser/extensions/formautofill/test/unit/test_getFormInputDetails.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /browser/extensions/formautofill/test/unit/test_getFormInputDetails.js
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/extensions/formautofill/test/unit/test_getFormInputDetails.js')
-rw-r--r--browser/extensions/formautofill/test/unit/test_getFormInputDetails.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/browser/extensions/formautofill/test/unit/test_getFormInputDetails.js b/browser/extensions/formautofill/test/unit/test_getFormInputDetails.js
index 18bd18b74a..cfcae8935d 100644
--- a/browser/extensions/formautofill/test/unit/test_getFormInputDetails.js
+++ b/browser/extensions/formautofill/test/unit/test_getFormInputDetails.js
@@ -1,11 +1,8 @@
"use strict";
-var FormAutofillContent;
-add_task(async function () {
- ({ FormAutofillContent } = ChromeUtils.importESModule(
- "resource://autofill/FormAutofillContent.sys.mjs"
- ));
-});
+const { FormStateManager } = ChromeUtils.importESModule(
+ "resource://gre/modules/shared/FormStateManager.sys.mjs"
+);
const TESTCASES = [
{
@@ -168,15 +165,16 @@ TESTCASES.forEach(testcase => {
for (let i in testcase.targetInput) {
let input = doc.getElementById(testcase.targetInput[i]);
- FormAutofillContent.identifyAutofillFields(input);
- FormAutofillContent.updateActiveInput(input);
+ const fsm = new FormStateManager();
+ fsm.updateActiveInput(input);
+ fsm.identifyAutofillFields(input);
// Put the input element reference to `element` to make sure the result of
// `activeFieldDetail` contains the same input element.
testcase.expectedResult[i].input.elementWeakRef = new WeakRef(input);
inputDetailAssertion(
- FormAutofillContent.activeFieldDetail,
+ fsm.activeFieldDetail,
testcase.expectedResult[i].input
);
@@ -193,7 +191,7 @@ TESTCASES.forEach(testcase => {
formDetail.elementWeakRef = new WeakRef(doc.querySelector(queryString));
}
- FormAutofillContent.activeFormDetails.forEach((detail, index) => {
+ fsm.activeFormDetails.forEach((detail, index) => {
inputDetailAssertion(detail, formDetails[index]);
});
}