Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java |
index 606c38246cc55778a5b3555005d252879b4c57e4..865e83b10a2317fe576059d040aada6ff46fbae5 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestContactDetailsTest.java |
@@ -39,6 +39,26 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase { |
helper.setCreditCard(new CreditCard("", "https://example.com", true, true, "Jon Doe", |
"4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_visa, |
billingAddressId, "" /* serverId */)); |
+ |
+ // Add the same profile but with a different address. |
+ helper.setProfile(new AutofillProfile("", "https://example.com", true, "", "Google", |
+ "999 Main St", "CA", "Los Angeles", "", "90291", "", "US", "555-555-5555", |
+ "jon.doe@google.com", "en-US")); |
+ |
+ // Add the same profile but without a phone number. |
+ helper.setProfile(new AutofillProfile("", "https://example.com", true, "Jon Doe", "Google", |
+ "340 Main St", "CA", "Los Angeles", "", "90291", "", "US", "", "jon.doe@google.com", |
please use gerrit instead
2016/12/16 20:34:51
"" /* phoneNumber */
Otherwise reader needs to th
sebsg
2016/12/19 20:56:30
Done.
|
+ "en-US")); |
+ |
+ // Add the same profile but without an email. |
+ helper.setProfile(new AutofillProfile("", "https://example.com", true, "Jon Doe", "Google", |
+ "340 Main St", "CA", "Los Angeles", "", "90291", "", "US", "555-555-5555", "", |
please use gerrit instead
2016/12/16 20:34:51
"" /* emailAddress */
sebsg
2016/12/19 20:56:30
Done.
|
+ "en-US")); |
+ |
+ // Add the same profile but without a name. |
+ helper.setProfile(new AutofillProfile("", "https://example.com", true, "", "Google", |
please use gerrit instead
2016/12/16 20:34:51
"" /* name */
sebsg
2016/12/19 20:56:30
Done.
|
+ "340 Main St", "CA", "Los Angeles", "", "90291", "", "US", "555-555-5555", |
+ "jon.doe@google.com", "en-US")); |
} |
/** Provide the existing valid payer name, phone number and email address to the merchant. */ |
@@ -216,6 +236,19 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase { |
} |
/** |
+ * Makes sure that suggestions that are equal to or subsets of other suggestions are not shown |
+ * to the user. |
+ */ |
+ @MediumTest |
+ @Feature({"Payments"}) |
+ public void testSuggestionsDeduped() |
+ throws InterruptedException, ExecutionException, TimeoutException { |
+ triggerUIAndWait(mReadyToPay); |
+ clickInContactInfoAndWait(R.id.payments_section, mReadyForInput); |
+ assertEquals(1, getNumberOfContactDetailSuggestions()); |
+ } |
+ |
+ /** |
* Test that starting a payment request that requires the user's email address, phone number and |
* name results in the appropriate metric being logged in the |
* PaymentRequest.RequestedInformation histogram. |