diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /toolkit/components/passwordmgr/test/mochitest/test_autocomplete_password_generation_confirm.html | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/passwordmgr/test/mochitest/test_autocomplete_password_generation_confirm.html')
-rw-r--r-- | toolkit/components/passwordmgr/test/mochitest/test_autocomplete_password_generation_confirm.html | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_password_generation_confirm.html b/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_password_generation_confirm.html index 54cb450815..b5db098174 100644 --- a/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_password_generation_confirm.html +++ b/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_password_generation_confirm.html @@ -146,21 +146,29 @@ Login Manager test: filling generated passwords into confirm password fields "resetLoginsAndGeneratedPasswords", () => { LoginTestUtils.clearData(); LoginTestUtils.resetGeneratedPasswordsCache(); + return Promise.resolve(); } ); }); function resetLoginsAndGeneratedPasswords() { - return setupScript.sendAsyncMessage("resetLoginsAndGeneratedPasswords"); + return setupScript.sendQuery("resetLoginsAndGeneratedPasswords"); } async function triggerPasswordGeneration(form) { await openPopupOn(form.pword); synthesizeKey("KEY_ArrowDown"); synthesizeKey("KEY_Enter"); + + const storageAddPromise = promiseStorageChanged(["addLogin"]); await SimpleTest.promiseWaitForCondition(() => !!form.pword.value, "Wait for generated password to get filled"); + await storageAddPromise; } + add_setup(async () => { + SpecialPowers.pushPrefEnv({"set": [["signon.webauthn.autocomplete", false]]}); + }) + add_named_task("autocomplete menu contains option to generate password", async () => { await resetLoginsAndGeneratedPasswords(); const form = setContentForTask(formTemplates.form1); @@ -206,7 +214,7 @@ Login Manager test: filling generated passwords into confirm password fields await resetLoginsAndGeneratedPasswords(); const form = setContentForTask(formTemplates.form1); await triggerPasswordGeneration(form); - is(form.pwordNext.value, form.pword.value, "Value of the confirm field has been filled with generated password"); + await SimpleTest.promiseWaitForCondition(() => form.pword.value == form.pwordNext.value, "Value of the confirm field has been filled with generated password"); }); add_named_task("password field is not masked initially after password generation", async () => { @@ -270,7 +278,7 @@ Login Manager test: filling generated passwords into confirm password fields form.pword.blur(); await messageSentPromise; - is(form.pwordNext.value, generatedPassword, "Value of the confirm field still holds the original generated password"); + await SimpleTest.promiseWaitForCondition(() => form.pwordNext.value == generatedPassword, "Value of the confirm field still holds the original generated password"); ok(form.pwordNext.matches(":autofill"), "Highlight is still applied to password confirmation field"); }); @@ -314,21 +322,21 @@ Login Manager test: filling generated passwords into confirm password fields form.pwordNext.focus() sendString("edited value"); await triggerPasswordGeneration(form); - is(form.pwordNext.value, "edited value", "Value of the confirm field has been filled with generated password"); + await SimpleTest.promiseWaitForCondition(() => form.pwordNext.value == "edited value", "Value of the confirm field has been filled with generated password"); }); add_named_task("password confirmation does not get filled with the generated password if its readonly", async () => { await resetLoginsAndGeneratedPasswords(); const form = setContentForTask(formTemplates.form3); await triggerPasswordGeneration(form); - is(form.pwordNext.value, "", "Value of the confirm field has been filled with generated password"); + await SimpleTest.promiseWaitForCondition(() => form.pwordNext.value == "", "Value of the confirm field has been filled with generated password"); }); add_named_task("password confirmation does not get filled with the generated password if its disabled", async () => { await resetLoginsAndGeneratedPasswords(); const form = setContentForTask(formTemplates.form4); await triggerPasswordGeneration(form); - is(form.pwordNext.value, "", "Value of the confirm field has been filled with generated password"); + await SimpleTest.promiseWaitForCondition(() => form.pwordNext.value == "", "Value of the confirm field has been filled with generated password"); }); add_named_task("password confirmation matching autocomplete info gets filled with the generated password", async () => { @@ -336,14 +344,14 @@ Login Manager test: filling generated passwords into confirm password fields const form = setContentForTask(formTemplates.form5); await triggerPasswordGeneration(form); is(form.pwordBetween.value, "", "Value of the between field has not been filled"); - is(form.pwordNext.value, form.pword.value, "Value of the confirm field has been filled with generated password"); + await SimpleTest.promiseWaitForCondition(() => form.pwordNext.value == form.pword.value, "Value of the confirm field has been filled with generated password"); }); add_named_task("password confirmation matching autocomplete info gets ignored if its disabled, even if has autocomplete info", async () => { await resetLoginsAndGeneratedPasswords(); const form = setContentForTask(formTemplates.form6); await triggerPasswordGeneration(form); - is(form.pwordNext.value, form.pword.value, "Value of the confirm field has been filled with generated password"); + await SimpleTest.promiseWaitForCondition(() => form.pwordNext.value == form.pword.value, "Value of the confirm field has been filled with generated password"); is(form.pwordAfter.value, "", "Value of the disabled confirmation field has not been filled"); }); @@ -365,7 +373,7 @@ Login Manager test: filling generated passwords into confirm password fields await resetLoginsAndGeneratedPasswords(); const form = setContentForTask(formTemplates.form9); await triggerPasswordGeneration(form); - is(form.pwordNext.value, form.pword.value, "Value of the confirm field has been filled with generated password"); + await SimpleTest.promiseWaitForCondition(() => form.pwordNext.value == form.pword.value, "Value of the confirm field has been filled with generated password"); }); add_named_task("do not fill third password field after the confirm-password field", async () => { |