diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /browser/extensions/formautofill/test/mochitest/test_multiple_forms.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/extensions/formautofill/test/mochitest/test_multiple_forms.html')
-rw-r--r-- | browser/extensions/formautofill/test/mochitest/test_multiple_forms.html | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/browser/extensions/formautofill/test/mochitest/test_multiple_forms.html b/browser/extensions/formautofill/test/mochitest/test_multiple_forms.html new file mode 100644 index 0000000000..feea55aae6 --- /dev/null +++ b/browser/extensions/formautofill/test/mochitest/test_multiple_forms.html @@ -0,0 +1,67 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Test autofill submit</title> + <script src="/tests/SimpleTest/EventUtils.js"></script> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script type="text/javascript" src="formautofill_common.js"></script> + <script type="text/javascript" src="satchel_common.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> + +<script> +/* import-globals-from ../../../../../toolkit/components/satchel/test/satchel_common.js */ + +"use strict"; + +let MOCK_STORAGE = [{ + "given-name": "John", + "additional-name": "R", + "family-name": "Smith", +}]; + +initPopupListener(); + +add_task(async function setupStorage() { + await addAddress(MOCK_STORAGE[0]); +}); + +add_task(async function check_switch_form_popup() { + await setInput("#additional-name", ""); + synthesizeKey("KEY_ArrowDown"); + await expectPopup(); + + // We need an intentional wait here before switching form. + await sleep(); + await setInput("#organization", ""); + synthesizeKey("KEY_ArrowDown"); + const {open: popupOpen} = await getPopupState(); + is(popupOpen, false); + + await sleep(); + await setInput("#given-name", ""); + synthesizeKey("KEY_ArrowDown"); + await expectPopup(); +}); + +</script> + +<div> + + <form> + <label>Name:<input id="name" autocomplete="name"></label> + <label>Organization:<input id="organization" autocomplete="organization"></label> + <label>City:<input autocomplete="address-level2"></label> + </form> + + <form> + <label>Given-Name: <input id="given-name" autocomplete="given-name"></label> + <label>Additional-Name/Middle: <input id="additional-name" autocomplete="additional-name"></label> + <label>FamilyName-LastName: <input id="family-name" autocomplete="family-name"></label> + </form> + +</div> +</body> +</html> |