--- a/browser/extensions/formautofill/FormAutofillHandler.jsm
+++ b/browser/extensions/formautofill/FormAutofillHandler.jsm
@@ -64,17 +64,17 @@ FormAutofillHandler.prototype = {
/**
* Similiar to `fieldDetails`, and `creditCardFieldDetails` contains the
* Credit Card records only.
*/
creditCardFieldDetails: null,
get isValidAddressForm() {
- return this.addressFieldDetails.length > FormAutofillUtils.AUTOFILL_FIELDS_THRESHOLD;
+ return this.addressFieldDetails.length >= FormAutofillUtils.AUTOFILL_FIELDS_THRESHOLD;
},
get isValidCreditCardForm() {
return this.creditCardFieldDetails.some(i => i.fieldName == "cc-number");
},
/**
* String of the filled profile's guid.
--- a/browser/extensions/formautofill/test/unit/test_collectFormFields.js
+++ b/browser/extensions/formautofill/test/unit/test_collectFormFields.js
@@ -112,47 +112,43 @@ const TESTCASES = [
},
},
{
description: "It's a valid address and credit card form.",
document: `<form>
<input id="given-name" autocomplete="shipping given-name">
<input id="family-name" autocomplete="shipping family-name">
<input id="street-addr" autocomplete="shipping street-address">
- <input id="city" autocomplete="shipping address-level2">
<input id="cc-number" autocomplete="shipping cc-number">
</form>`,
addressFieldDetails: [
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "given-name"},
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "family-name"},
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "street-address"},
- {"section": "", "addressType": "shipping", "contactType": "", "fieldName": "address-level2"},
],
creditCardFieldDetails: [
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "cc-number"},
],
isValidForm: {
address: true,
creditCard: true,
},
},
{
description: "It's an invalid address and credit form.",
document: `<form>
<input id="given-name" autocomplete="shipping given-name">
<input autocomplete="shipping address-level2">
- <select autocomplete="shipping country"></select>
<input id="cc-name" autocomplete="cc-name">
<input id="cc-exp-month" autocomplete="cc-exp-month">
<input id="cc-exp-year" autocomplete="cc-exp-year">
</form>`,
addressFieldDetails: [
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "given-name"},
{"section": "", "addressType": "shipping", "contactType": "", "fieldName": "address-level2"},
- {"section": "", "addressType": "shipping", "contactType": "", "fieldName": "country"},
],
creditCardFieldDetails: [
{"section": "", "addressType": "", "contactType": "", "fieldName": "cc-name"},
{"section": "", "addressType": "", "contactType": "", "fieldName": "cc-exp-month"},
{"section": "", "addressType": "", "contactType": "", "fieldName": "cc-exp-year"},
],
isValidForm: {
address: false,