From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../browser/heuristics/browser_multiple_section.js | 118 +++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js (limited to 'browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js') diff --git a/browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js b/browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js new file mode 100644 index 0000000000..078f2240db --- /dev/null +++ b/browser/extensions/formautofill/test/browser/heuristics/browser_multiple_section.js @@ -0,0 +1,118 @@ +/* global add_heuristic_tests */ + +"use strict"; + +add_heuristic_tests( + [ + { + fixturePath: "multiple_section.html", + expectedResult: [ + { + default: { + reason: "autocomplete", + addressType: "shipping", + }, + fields: [ + { fieldName: "name", addressType: "" }, + { fieldName: "organization", addressType: "" }, + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + ], + }, + { + default: { + reason: "autocomplete", + addressType: "billing", + }, + fields: [ + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + ], + }, + { + default: { + reason: "autocomplete", + section: "section-my", + }, + fields: [ + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + { fieldName: "tel", section: "", contactType: "work" }, + { fieldName: "email", section: "", contactType: "work" }, + ], + }, + { + invalid: true, + default: { + reason: "autocomplete", + }, + fields: [ + // Even the `contactType` of these two fields are different with the + // above two, we still consider they are identical until supporting + // multiple phone number and email in one profile. + { fieldName: "tel", contactType: "home" }, + { fieldName: "email", contactType: "home" }, + ], + }, + { + default: { + reason: "autocomplete", + }, + fields: [ + { fieldName: "name" }, + { fieldName: "organization" }, + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + ], + }, + { + default: { + reason: "autocomplete", + }, + fields: [ + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + ], + }, + { + default: { + reason: "autocomplete", + }, + fields: [ + { fieldName: "street-address" }, + { fieldName: "address-level2" }, + { fieldName: "address-level1" }, + { fieldName: "postal-code" }, + { fieldName: "country" }, + { fieldName: "tel", contactType: "work" }, + { fieldName: "email", contactType: "work" }, + ], + }, + { + invalid: true, + default: { + reason: "autocomplete", + contactType: "home", + }, + fields: [{ fieldName: "tel" }, { fieldName: "email" }], + }, + ], + }, + ], + "fixtures/" +); -- cgit v1.2.3