Open Bug 1762063 Opened 2 years ago Updated 2 years ago

Fix global variables in formautofill/test/unit/head.js

Categories

(Toolkit :: Form Autofill, task, P3)

task

Tracking

()

People

(Reporter: tgiles, Unassigned)

Details

In L203-204 in formautofill/test/unit/head.js, there are four global variables that are declared but not assigned values unless runHeuristicsTest is called. This means if you try to utilize FormAutofillUtils in a xpcshell test, you must declare it as such:
({ FormAutofillUtils } = ChromeUtils.import("resource://autofill/FormAutofillUtils.jsm")); note the extra parentheses. If you attempt to declare it like other modules say: { FormAutofillUtils } = ChromeUtils.import("resource://autofill/FormAutofillUtils.jsm"), you will receive an error saying that the FormAutofillUtils has already been declared with no straightforward way to fix this issue.

I don't think we should be declaring modules' names as uninitialized variables in our test code. This will also allow us to clean up these destructuring calls that have extra parentheses.

Priority: -- → P3
Severity: -- → N/A
You need to log in before you can comment on or make changes to this bug.