From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../test/mochitest/creditCard/test_clear_form.html | 1 - .../test_clear_form_expiry_select_elements.html | 1 - ...w_highlight_with_multiple_cc_number_fields.html | 2 -- .../test/mochitest/formautofill_common.js | 22 -------------- .../test/mochitest/formautofill_parent_utils.js | 34 ++++++++-------------- .../mochitest/test_autofill_and_ordinal_forms.html | 6 ++-- .../test/mochitest/test_form_changes.html | 3 +- 7 files changed, 15 insertions(+), 54 deletions(-) (limited to 'browser/extensions/formautofill/test/mochitest') diff --git a/browser/extensions/formautofill/test/mochitest/creditCard/test_clear_form.html b/browser/extensions/formautofill/test/mochitest/creditCard/test_clear_form.html index 3d8049f053..a1a3322c4e 100644 --- a/browser/extensions/formautofill/test/mochitest/creditCard/test_clear_form.html +++ b/browser/extensions/formautofill/test/mochitest/creditCard/test_clear_form.html @@ -69,7 +69,6 @@ async function checkIsFormCleared(patch = {}) { const expectedValue = patch[elem.id] || ""; checkFieldValue(elem, expectedValue); await checkFieldHighlighted(elem, false); - await checkFieldPreview(elem, ""); } } diff --git a/browser/extensions/formautofill/test/mochitest/creditCard/test_clear_form_expiry_select_elements.html b/browser/extensions/formautofill/test/mochitest/creditCard/test_clear_form_expiry_select_elements.html index 4fc989a36e..6ebef3bba1 100644 --- a/browser/extensions/formautofill/test/mochitest/creditCard/test_clear_form_expiry_select_elements.html +++ b/browser/extensions/formautofill/test/mochitest/creditCard/test_clear_form_expiry_select_elements.html @@ -54,7 +54,6 @@ async function checkIsFormCleared(patch = {}) { const expectedValue = patch[elem.id] || ""; checkFieldValue(elem, expectedValue); await checkFieldHighlighted(elem, false); - await checkFieldPreview(elem, ""); } } diff --git a/browser/extensions/formautofill/test/mochitest/creditCard/test_preview_highlight_with_multiple_cc_number_fields.html b/browser/extensions/formautofill/test/mochitest/creditCard/test_preview_highlight_with_multiple_cc_number_fields.html index 6b0d7a522c..a6d0572ac6 100644 --- a/browser/extensions/formautofill/test/mochitest/creditCard/test_preview_highlight_with_multiple_cc_number_fields.html +++ b/browser/extensions/formautofill/test/mochitest/creditCard/test_preview_highlight_with_multiple_cc_number_fields.html @@ -72,9 +72,7 @@ async function checkMultipleCCNumberFormStyle(profile, isPreviewing = true) { } else { fillableValue = profile[element.id]; } - let previewValue = (isPreviewing && fillableValue) || ""; await checkFieldHighlighted(element, !!fillableValue); - await checkFieldPreview(element, previewValue); } } diff --git a/browser/extensions/formautofill/test/mochitest/formautofill_common.js b/browser/extensions/formautofill/test/mochitest/formautofill_common.js index 6dbfa7c918..6cdf9ca86b 100644 --- a/browser/extensions/formautofill/test/mochitest/formautofill_common.js +++ b/browser/extensions/formautofill/test/mochitest/formautofill_common.js @@ -104,27 +104,6 @@ async function checkFieldHighlighted(elem, expectedValue) { is(isHighlightApplied, expectedValue, `Checking #${elem.id} highlight style`); } -async function checkFieldPreview(elem, expectedValue) { - is( - SpecialPowers.wrap(elem).previewValue, - expectedValue, - `Checking #${elem.id} previewValue` - ); - let isTextColorApplied; - await SimpleTest.promiseWaitForCondition(function checkPreview() { - const computedStyle = window.getComputedStyle(elem); - const actualColor = computedStyle.getPropertyValue("color"); - if (elem.disabled) { - isTextColorApplied = actualColor !== defaultDisabledTextColor; - } else { - isTextColorApplied = actualColor !== defaultTextColor; - } - return isTextColorApplied === !!expectedValue; - }, `Checking #${elem.id} preview style`); - - is(isTextColorApplied, !!expectedValue, `Checking #${elem.id} preview style`); -} - async function checkFormFieldsStyle(profile, isPreviewing = true) { const elems = document.querySelectorAll("input, select"); @@ -143,7 +122,6 @@ async function checkFormFieldsStyle(profile, isPreviewing = true) { (isPreviewing && fillableValue?.toString().replaceAll("*", "•")) || ""; } await checkFieldHighlighted(elem, !!fillableValue); - await checkFieldPreview(elem, previewValue); } } diff --git a/browser/extensions/formautofill/test/mochitest/formautofill_parent_utils.js b/browser/extensions/formautofill/test/mochitest/formautofill_parent_utils.js index c133e535f5..97e62657d3 100644 --- a/browser/extensions/formautofill/test/mochitest/formautofill_parent_utils.js +++ b/browser/extensions/formautofill/test/mochitest/formautofill_parent_utils.js @@ -129,11 +129,11 @@ var ParentUtils = { }, async operateAddress(type, msgData) { - await this._operateRecord(ADDRESSES_COLLECTION_NAME, ...arguments); + await this._operateRecord(ADDRESSES_COLLECTION_NAME, type, msgData); }, async operateCreditCard(type, msgData) { - await this._operateRecord(CREDITCARDS_COLLECTION_NAME, ...arguments); + await this._operateRecord(CREDITCARDS_COLLECTION_NAME, type, msgData); }, async cleanUpAddresses() { @@ -145,11 +145,7 @@ var ParentUtils = { return; } - await this.operateAddress( - "remove", - { guids }, - "FormAutofillTest:AddressesCleanedUp" - ); + await this.operateAddress("remove", { guids }); }, async cleanUpCreditCards() { @@ -164,11 +160,7 @@ var ParentUtils = { return; } - await this.operateCreditCard( - "remove", - { guids }, - "FormAutofillTest:CreditCardsCleanedUp" - ); + await this.operateCreditCard("remove", { guids }); }, setup() { @@ -268,7 +260,7 @@ addMessageListener("FormAutofillTest:CheckAddresses", msg => { return ParentUtils.checkAddresses(msg); }); -addMessageListener("FormAutofillTest:CleanUpAddresses", msg => { +addMessageListener("FormAutofillTest:CleanUpAddresses", _msg => { return ParentUtils.cleanUpAddresses(); }); @@ -284,23 +276,21 @@ addMessageListener("FormAutofillTest:CheckCreditCards", msg => { return ParentUtils.checkCreditCards(msg); }); -addMessageListener("FormAutofillTest:CleanUpCreditCards", msg => { +addMessageListener("FormAutofillTest:CleanUpCreditCards", _msg => { return ParentUtils.cleanUpCreditCards(); }); -addMessageListener("FormAutofillTest:CanTestOSKeyStoreLogin", msg => { +addMessageListener("FormAutofillTest:CanTestOSKeyStoreLogin", _msg => { return { canTest: OSKeyStoreTestUtils.canTestOSKeyStoreLogin() }; }); -addMessageListener("FormAutofillTest:OSKeyStoreLogin", async msg => { - await OSKeyStoreTestUtils.waitForOSKeyStoreLogin(msg.login); -}); +addMessageListener("FormAutofillTest:OSKeyStoreLogin", msg => + OSKeyStoreTestUtils.waitForOSKeyStoreLogin(msg.login) +); -addMessageListener("setup", async () => { - ParentUtils.setup(); -}); +addMessageListener("setup", async _msg => ParentUtils.setup()); -addMessageListener("cleanup", async () => { +addMessageListener("cleanup", async _msg => { destroyed = true; await ParentUtils.cleanup(); }); diff --git a/browser/extensions/formautofill/test/mochitest/test_autofill_and_ordinal_forms.html b/browser/extensions/formautofill/test/mochitest/test_autofill_and_ordinal_forms.html index 54efc83359..ab3c08e89a 100644 --- a/browser/extensions/formautofill/test/mochitest/test_autofill_and_ordinal_forms.html +++ b/browser/extensions/formautofill/test/mochitest/test_autofill_and_ordinal_forms.html @@ -47,9 +47,8 @@ add_task(async function check_switch_autofill_form_popup() { checkMenuEntries( [ `{"primary":"+13453453456","secondary":"123 Sesame Street."}`, - `{"primary":"","secondary":"","categories":["organization","address","tel","name"],"focusedCategory":"tel"}`, ], - false + true ); await testMenuEntry(0, "!(el instanceof MozElements.MozAutocompleteRichlistitem)"); @@ -75,9 +74,8 @@ add_task(async function check_switch_autofill_form_popup_back() { checkMenuEntries( [ `{"primary":"+13453453456","secondary":"123 Sesame Street."}`, - `{"primary":"","secondary":"","categories":["organization","address","tel","name"],"focusedCategory":"tel"}`, ], - false + true ); await testMenuEntry(0, "!(el instanceof MozElements.MozAutocompleteRichlistitem)"); diff --git a/browser/extensions/formautofill/test/mochitest/test_form_changes.html b/browser/extensions/formautofill/test/mochitest/test_form_changes.html index 2eace91a53..1bfc655328 100644 --- a/browser/extensions/formautofill/test/mochitest/test_form_changes.html +++ b/browser/extensions/formautofill/test/mochitest/test_form_changes.html @@ -77,8 +77,7 @@ async function checkFormChangeHappened(formId) { // Click on an autofilled field would show an autocomplete popup with "clear form" entry checkMenuEntries([ JSON.stringify({primary: "", secondary: ""}), // Clear Autofill Form - JSON.stringify({primary: "", secondary: ""}) // FormAutofill Preferemce - ], false); + ], true); // This is for checking the changes of element removed and added then. document.querySelector(`#${formId} input[name=address-level2]`).remove(); -- cgit v1.2.3