OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 static java.util.Arrays.asList; | 7 import static java.util.Arrays.asList; |
8 | 8 |
9 import android.os.Handler; | 9 import android.os.Handler; |
10 import android.view.KeyEvent; | 10 import android.view.KeyEvent; |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 @Override | 416 @Override |
417 public String call() { | 417 public String call() { |
418 return mUI.getShippingOptionSectionForTest() | 418 return mUI.getShippingOptionSectionForTest() |
419 .getSummaryLabelForTest() | 419 .getSummaryLabelForTest() |
420 .getText() | 420 .getText() |
421 .toString(); | 421 .toString(); |
422 } | 422 } |
423 }); | 423 }); |
424 } | 424 } |
425 | 425 |
| 426 protected String getShippingOptionCostSummary() throws ExecutionException { |
| 427 return ThreadUtils.runOnUiThreadBlocking(new Callable<String>() { |
| 428 @Override |
| 429 public String call() { |
| 430 return mUI.getShippingOptionSectionForTest() |
| 431 .getSummarySubLabelForTest() |
| 432 .getText() |
| 433 .toString(); |
| 434 } |
| 435 }); |
| 436 } |
| 437 |
426 protected View getCardEditorFocusedView() { | 438 protected View getCardEditorFocusedView() { |
427 return mUI.getCardEditorDialog().getCurrentFocus(); | 439 return mUI.getCardEditorDialog().getCurrentFocus(); |
428 } | 440 } |
429 | 441 |
430 protected void clickOnShippingAddressSuggestionOptionAndWait( | 442 protected void clickOnShippingAddressSuggestionOptionAndWait( |
431 final int suggestionIndex, CallbackHelper helper) | 443 final int suggestionIndex, CallbackHelper helper) |
432 throws ExecutionException, TimeoutException, InterruptedException { | 444 throws ExecutionException, TimeoutException, InterruptedException { |
433 Assert.assertTrue(suggestionIndex < getNumberOfShippingAddressSuggestion
s()); | 445 Assert.assertTrue(suggestionIndex < getNumberOfShippingAddressSuggestion
s()); |
434 | 446 |
435 int callCount = helper.getCallCount(); | 447 int callCount = helper.getCallCount(); |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 } | 1007 } |
996 | 1008 |
997 public interface PaymentRequestTestCommonCallback { | 1009 public interface PaymentRequestTestCommonCallback { |
998 ChromeTabbedActivity getActivity(); | 1010 ChromeTabbedActivity getActivity(); |
999 void onMainActivityStarted() | 1011 void onMainActivityStarted() |
1000 throws InterruptedException, ExecutionException, TimeoutExceptio
n; | 1012 throws InterruptedException, ExecutionException, TimeoutExceptio
n; |
1001 void startMainActivityWithURL(String url) throws InterruptedException; | 1013 void startMainActivityWithURL(String url) throws InterruptedException; |
1002 void assertWaitForPageScaleFactorMatch(float expectedScale); | 1014 void assertWaitForPageScaleFactorMatch(float expectedScale); |
1003 } | 1015 } |
1004 } | 1016 } |
OLD | NEW |