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:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /browser/extensions/formautofill/test/unit/test_getFormInputDetails.js
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 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]);
});
}