Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2374)

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNameTest.java

Issue 2583593002: [Payments] Dedupe subsets in contact detail suggestions. (Closed)
Patch Set: Nit Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNameTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNameTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNameTest.java
index 594ba10b95feda7ea214335cd7f4953bbb0c2e05..cc926946efa77b8e0b01d014d676449aed97a969 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNameTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestNameTest.java
@@ -37,6 +37,26 @@ public class PaymentRequestNameTest 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", "" /* phone_number */,
+ "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",
+ "" /* emailAddress */, "en-US"));
+
+ // Add the same profile but without a name.
+ helper.setProfile(new AutofillProfile("" /* name */, "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 payer name to the merchant. */
@@ -82,6 +102,19 @@ public class PaymentRequestNameTest 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 payer name results in
* the appropriate metric being logged in the PaymentRequest.RequestedInformation histogram.
*/

Powered by Google App Engine
This is Rietveld 408576698