diff --git a/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_tab_between_fields.html b/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_tab_between_fields.html --- a/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_tab_between_fields.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_tab_between_fields.html @@ -93,11 +93,11 @@ add_setup(async () => { await SpecialPowers.pushPrefEnv({"set": [["signon.includeOtherSubdomainsInLookup", true]]}); }); async function testResultOfTabInteractions(testData) { - const logins = testData.logins.map(name => availableLogins[name]); + let logins = testData.logins.map(name => availableLogins[name]); await setStoredLoginsAsync(...logins); const form = createLoginForm({ action: "https://autofill" }); @@ -110,19 +110,21 @@ SpecialPowers.wrap(form.pword).setUserInput(""); SpecialPowers.wrap(form.uname).setUserInput(""); info("Placing focus in the password field"); + const shownPromise = popupBy(); form.pword.focus(); await synthesizeKey("KEY_Tab", { shiftKey: true }); // blur pw, focus un await new Promise(resolve => SimpleTest.executeSoon(resolve)); // moving focus shouldn't change anything checkForm(1, "", ""); + await synthesizeKey("KEY_ArrowDown"); info("waiting for AC results"); - const results = await popupByArrowDown(); + let results = await shownPromise; info("checking results"); checkAutoCompleteResults(results, testData.expectedACLabels, window.location.host, "Check all rows are correct"); if (testData.typeUsername) { @@ -149,12 +151,12 @@ ok(form.pword.matches("input:focus"), "pword field is focused"); checkForm(1, testData.expectedTabbedUsername, testData.expectedTabbedPassword); } -for (const testData of tests) { - const tmp = { +for (let testData of tests) { + let tmp = { async [testData.name]() { await testResultOfTabInteractions(testData); }, }; add_task(tmp[testData.name]);