| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.payments; | 5 package org.chromium.chrome.browser.payments; |
| 6 | 6 |
| 7 import android.test.suitebuilder.annotation.MediumTest; | 7 import android.test.suitebuilder.annotation.MediumTest; |
| 8 | 8 |
| 9 import org.chromium.base.test.util.CommandLineFlags; | |
| 10 import org.chromium.base.test.util.Feature; | 9 import org.chromium.base.test.util.Feature; |
| 11 import org.chromium.chrome.R; | 10 import org.chromium.chrome.R; |
| 12 import org.chromium.chrome.browser.autofill.AutofillTestHelper; | 11 import org.chromium.chrome.browser.autofill.AutofillTestHelper; |
| 13 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; | 12 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
| 14 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; | 13 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; |
| 15 | 14 |
| 16 import java.util.concurrent.ExecutionException; | 15 import java.util.concurrent.ExecutionException; |
| 17 import java.util.concurrent.TimeoutException; | 16 import java.util.concurrent.TimeoutException; |
| 18 | 17 |
| 19 /** | 18 /** |
| 20 * A payment integration test for checking whether user can make a payment via a
credit card. | 19 * A payment integration test for checking whether user can make a payment via a
credit card. |
| 21 * This user has a complete credit card on file. | 20 * This user has a complete credit card on file. |
| 22 */ | 21 */ |
| 23 @CommandLineFlags.Add("enable-blink-features=CanMakePayment") | |
| 24 public class PaymentRequestCcCanMakePaymentQueryTest extends PaymentRequestTestB
ase { | 22 public class PaymentRequestCcCanMakePaymentQueryTest extends PaymentRequestTestB
ase { |
| 25 public PaymentRequestCcCanMakePaymentQueryTest() { | 23 public PaymentRequestCcCanMakePaymentQueryTest() { |
| 26 super("payment_request_can_make_payment_query_cc_test.html"); | 24 super("payment_request_can_make_payment_query_cc_test.html"); |
| 27 } | 25 } |
| 28 | 26 |
| 29 @Override | 27 @Override |
| 30 public void onMainActivityStarted() throws InterruptedException, ExecutionEx
ception, | 28 public void onMainActivityStarted() throws InterruptedException, ExecutionEx
ception, |
| 31 TimeoutException { | 29 TimeoutException { |
| 32 // The user has a complete credit card on file. This is sufficient for | 30 // The user has a complete credit card on file. This is sufficient for |
| 33 // canMakePayment() to return true. | 31 // canMakePayment() to return true. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 56 | 54 |
| 57 // Different queries are throttled for a period of time. | 55 // Different queries are throttled for a period of time. |
| 58 clickNodeAndWait("other-buy", mCanMakePaymentQueryResponded); | 56 clickNodeAndWait("other-buy", mCanMakePaymentQueryResponded); |
| 59 expectResultContains(new String[]{"Query quota exceeded"}); | 57 expectResultContains(new String[]{"Query quota exceeded"}); |
| 60 | 58 |
| 61 // Repeating the same query again does not count against the quota. | 59 // Repeating the same query again does not count against the quota. |
| 62 clickNodeAndWait("buy", mCanMakePaymentQueryResponded); | 60 clickNodeAndWait("buy", mCanMakePaymentQueryResponded); |
| 63 expectResultContains(new String[]{"true"}); | 61 expectResultContains(new String[]{"true"}); |
| 64 } | 62 } |
| 65 } | 63 } |
| OLD | NEW |