Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestEmailTest.java |
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestEmailTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestEmailTest.java |
index 9b5e47b251c6bd2df5292e3715f7549991f6c9dc..9c4effb3ddb5ad0438cf7a92a4b2d66f9b7821aa 100644 |
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestEmailTest.java |
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestEmailTest.java |
@@ -38,6 +38,26 @@ public class PaymentRequestEmailTest 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", |
+ "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", "", |
+ "en-US")); |
+ |
+ // Add the same profile but without a name. |
+ helper.setProfile(new AutofillProfile("", "https://example.com", true, "", "Google", |
+ "340 Main St", "CA", "Los Angeles", "", "90291", "", "US", "555-555-5555", |
+ "jon.doe@google.com", "en-US")); |
} |
/** Provide the existing valid email address to the merchant. */ |
@@ -84,6 +104,19 @@ public class PaymentRequestEmailTest 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 only the user's email address results in |
* the appropriate metric being logged in the PaymentRequest.RequestedInformation histogram. |
*/ |