Skip to content
Snippets Groups Projects
Commit a1c60a65 authored by Johannes J. Schmidt's avatar Johannes J. Schmidt
Browse files

Bug 1800296 - fix test_autocomplete_tab_between_fields.html intermittent -...

Bug 1800296 - fix test_autocomplete_tab_between_fields.html intermittent - r=credential-management-reviewers,sgalich,dimi a=test-only

and enable the test again

Differential Revision: https://phabricator.services.mozilla.com/D179798
parent 02506406
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,6 @@ skip-if = toolkit == 'android' # autocomplete
scheme = https
skip-if =
xorigin || toolkit == 'android' # autocomplete
os == "linux" # Bug 1800296
[test_autofill_autocomplete_types.html]
scheme = https
skip-if = toolkit == 'android' # bug 1533965
......
......@@ -114,10 +114,9 @@ async function testResultOfTabInteractions(testData) {
info("Placing focus in the password field");
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 ensureLoginFormStaysFilledWith(form.uname, "", form.pword, "");
info("waiting for AC results");
const results = await popupByArrowDown();
......@@ -137,18 +136,20 @@ async function testResultOfTabInteractions(testData) {
}, "AutoComplete popup should have closed");
await synthesizeKey("KEY_Tab");
// Filling password is performed asynchronously. So, let's wait the value
// change instead of just waiting next event loop.
// wait until username and password are automatically filled in with the
// expected values...
await TestUtils.waitForCondition(() => {
return form.uname.value === testData.expectedTabbedUsername & form.pword.value === testData.expectedTabbedPassword;
}, "Username and password field should be filled");
// ...and if the value is not different from the original value in the form,
// make sure that the form keeps its values
if (testData.expectedTabbedPassword === "") {
await new Promise(resolve => SimpleTest.executeSoon(resolve));
} else {
await TestUtils.waitForCondition(() => {
return form.pword.value === testData.expectedTabbedPassword;
}, "Password field should be filled");
await ensureLoginFormStaysFilledWith(form.uname, testData.expectedTabbedUsername, form.pword, testData.expectedTabbedPassword);
}
ok(form.pword.matches("input:focus"), "pword field is focused");
checkForm(1, testData.expectedTabbedUsername, testData.expectedTabbedPassword);
}
for (const testData of tests) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment