summaryrefslogtreecommitdiffstats
path: root/browser/extensions/formautofill/test/unit/test_getFormInputDetails.js
diff options
context:
space:
mode:
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]);
});
}