| Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBasicCardTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBasicCardTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBasicCardTest.java
|
| index a4fb11ce8d5ebac0221b6a8cbce9b74968341ac0..a2a2e5334fe4ea59748dd30ac73c0c475c9c4944 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBasicCardTest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestBasicCardTest.java
|
| @@ -44,7 +44,7 @@ public class PaymentRequestBasicCardTest extends PaymentRequestTestBase {
|
| public void testCanPayWithBasicCard() throws InterruptedException,
|
| ExecutionException, TimeoutException {
|
| openPageAndClickNodeAndWait("checkBasicCard", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"true"});
|
| + expectResultContains(new String[] {"true"});
|
|
|
| clickNodeAndWait("buyBasicCard", mReadyForInput);
|
| }
|
| @@ -54,7 +54,7 @@ public class PaymentRequestBasicCardTest extends PaymentRequestTestBase {
|
| public void testIgnoreCardType() throws InterruptedException,
|
| ExecutionException, TimeoutException {
|
| openPageAndClickNodeAndWait("checkBasicDebit", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"true"});
|
| + expectResultContains(new String[] {"true"});
|
|
|
| clickNodeAndWait("buyBasicDebit", mReadyForInput);
|
| }
|
| @@ -64,42 +64,37 @@ public class PaymentRequestBasicCardTest extends PaymentRequestTestBase {
|
| public void testCannotMakeActivePaymentWithBasicMasterCard() throws InterruptedException,
|
| ExecutionException, TimeoutException {
|
| openPageAndClickNodeAndWait("checkBasicMasterCard", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"false"});
|
| + expectResultContains(new String[] {"false"});
|
|
|
| reTriggerUIAndWait("buyBasicMasterCard", mReadyForInput);
|
| }
|
|
|
| - /**
|
| - * To prevent fingerprinting the user, repeated queries for "basic-card" payment method return
|
| - * cached results, even if the queries were performed with different sets of "supportedNetworks"
|
| - * and "supportedTypes" every time.
|
| - */
|
| @MediumTest
|
| @Feature({"Payments"})
|
| - public void testReturnsCachedResultForBasiCard() throws InterruptedException,
|
| - ExecutionException, TimeoutException {
|
| + public void testSupportedNetworksMustMatchForCanMakePayment()
|
| + throws InterruptedException, ExecutionException, TimeoutException {
|
| openPageAndClickNodeAndWait("checkBasicVisa", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"true"});
|
| + expectResultContains(new String[] {"true"});
|
| +
|
| + clickNodeAndWait("checkBasicMasterCard", mCanMakePaymentQueryResponded);
|
| + expectResultContains(new String[] {"Query quota exceeded"});
|
|
|
| clickNodeAndWait("checkBasicVisa", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"true"});
|
| + expectResultContains(new String[] {"true"});
|
| + }
|
|
|
| - // Cached result for "basic-card" is "true", even though the user does not have a MasterCard
|
| - // on file.
|
| - clickNodeAndWait("checkBasicMasterCard", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"true"});
|
| + @MediumTest
|
| + @Feature({"Payments"})
|
| + public void testSupportedTypesMustMatchForCanMakePayment()
|
| + throws InterruptedException, ExecutionException, TimeoutException {
|
| + openPageAndClickNodeAndWait("checkBasicVisa", mCanMakePaymentQueryResponded);
|
| + expectResultContains(new String[] {"true"});
|
|
|
| - // Cached result for "basic-card" is "true".
|
| clickNodeAndWait("checkBasicDebit", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"true"});
|
| -
|
| - // Checking for "visa" immediately after "basic-card" triggers throttling.
|
| - clickNodeAndWait("checkVisa", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"Query quota exceeded"});
|
| + expectResultContains(new String[] {"Query quota exceeded"});
|
|
|
| - // Checking for "mastercard" immediately after "basic-card" triggers throttling.
|
| - clickNodeAndWait("checkMasterCard", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"Query quota exceeded"});
|
| + clickNodeAndWait("checkBasicVisa", mCanMakePaymentQueryResponded);
|
| + expectResultContains(new String[] {"true"});
|
| }
|
|
|
| /**
|
| @@ -112,7 +107,7 @@ public class PaymentRequestBasicCardTest extends PaymentRequestTestBase {
|
| public void testPayWithBasicCard() throws InterruptedException, ExecutionException,
|
| TimeoutException {
|
| openPageAndClickNodeAndWait("checkBasicVisa", mCanMakePaymentQueryResponded);
|
| - expectResultContains(new String[]{"true"});
|
| + expectResultContains(new String[] {"true"});
|
|
|
| reTriggerUIAndWait("buy", mReadyToPay);
|
| clickAndWait(R.id.button_primary, mReadyForUnmaskInput);
|
|
|