| 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.support.test.filters.MediumTest; | 7 import android.support.test.filters.MediumTest; |
| 8 | 8 |
| 9 import org.junit.Assert; | 9 import org.junit.Assert; |
| 10 import org.junit.Rule; | 10 import org.junit.Rule; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 new PaymentRequestTestRule("payment_request_dynamic_shipping_test.ht
ml", this); | 46 new PaymentRequestTestRule("payment_request_dynamic_shipping_test.ht
ml", this); |
| 47 | 47 |
| 48 @Override | 48 @Override |
| 49 public void onMainActivityStarted() | 49 public void onMainActivityStarted() |
| 50 throws InterruptedException, ExecutionException, TimeoutException { | 50 throws InterruptedException, ExecutionException, TimeoutException { |
| 51 AutofillTestHelper helper = new AutofillTestHelper(); | 51 AutofillTestHelper helper = new AutofillTestHelper(); |
| 52 String billingAddressId = helper.setProfile(new AutofillProfile("", "htt
ps://example.com", | 52 String billingAddressId = helper.setProfile(new AutofillProfile("", "htt
ps://example.com", |
| 53 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "
", "90291", "", | 53 true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "
", "90291", "", |
| 54 "US", "555-555-5555", "jon.doe@google.com", "en-US")); | 54 "US", "555-555-5555", "jon.doe@google.com", "en-US")); |
| 55 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru
e, "Jon Doe", | 55 helper.setCreditCard(new CreditCard("", "https://example.com", true, tru
e, "Jon Doe", |
| 56 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_
visa, | 56 "4111111111111111", "1111", "12", "2050", "visa", R.drawable.vis
a_card, |
| 57 billingAddressId, "" /* serverId */)); | 57 billingAddressId, "" /* serverId */)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 /** If the user switches tabs somehow, the dialog is dismissed. */ | 60 /** If the user switches tabs somehow, the dialog is dismissed. */ |
| 61 @Test | 61 @Test |
| 62 @MediumTest | 62 @MediumTest |
| 63 @Feature({"Payments"}) | 63 @Feature({"Payments"}) |
| 64 public void testDismissOnTabSwitch() | 64 public void testDismissOnTabSwitch() |
| 65 throws InterruptedException, ExecutionException, TimeoutException { | 65 throws InterruptedException, ExecutionException, TimeoutException { |
| 66 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead
yForInput()); | 66 mPaymentRequestTestRule.triggerUIAndWait(mPaymentRequestTestRule.getRead
yForInput()); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 106 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 107 @Override | 107 @Override |
| 108 public void run() { | 108 public void run() { |
| 109 TabModel currentModel = mPaymentRequestTestRule.getActivity().ge
tCurrentTabModel(); | 109 TabModel currentModel = mPaymentRequestTestRule.getActivity().ge
tCurrentTabModel(); |
| 110 TabModelUtils.getCurrentTab(currentModel).loadUrl(new LoadUrlPar
ams("about:blank")); | 110 TabModelUtils.getCurrentTab(currentModel).loadUrl(new LoadUrlPar
ams("about:blank")); |
| 111 } | 111 } |
| 112 }); | 112 }); |
| 113 mPaymentRequestTestRule.getDismissed().waitForCallback(0); | 113 mPaymentRequestTestRule.getDismissed().waitForCallback(0); |
| 114 } | 114 } |
| 115 } | 115 } |
| OLD | NEW |