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

Side by Side Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestCommon.java

Issue 2885443003: enable modifiers for native apps (Closed)
Patch Set: fix compilation error Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 @Override 331 @Override
332 public String call() { 332 public String call() {
333 return ((OptionSection) mUI.getPaymentMethodSectionForTest()) 333 return ((OptionSection) mUI.getPaymentMethodSectionForTest())
334 .getOptionLabelsForTest(index) 334 .getOptionLabelsForTest(index)
335 .getText() 335 .getText()
336 .toString(); 336 .toString();
337 } 337 }
338 }); 338 });
339 } 339 }
340 340
341 protected String getSelectedPaymentInstrumentLabel() throws ExecutionExcepti on {
342 return ThreadUtils.runOnUiThreadBlocking(new Callable<String>() {
343 @Override
344 public String call() {
345 OptionSection section = ((OptionSection) mUI.getPaymentMethodSec tionForTest());
346 int size = section.getNumberOfOptionLabelsForTest();
347 for (int i = 0; i < size; i++) {
348 if (section.getOptionRowAtIndex(i).isChecked()) {
349 return section.getOptionRowAtIndex(i).getLabelText().toS tring();
350 }
351 }
352 return null;
353 }
354 });
355 }
356
357 protected String getOrderSummaryTotal() throws ExecutionException {
358 return ThreadUtils.runOnUiThreadBlocking(new Callable<String>() {
359 @Override
360 public String call() {
361 return mUI.getOrderSummaryTotalTextViewForTest().getText().toStr ing();
362 }
363 });
364 }
365
341 protected String getContactDetailsSuggestionLabel(final int suggestionIndex) 366 protected String getContactDetailsSuggestionLabel(final int suggestionIndex)
342 throws ExecutionException { 367 throws ExecutionException {
343 return ThreadUtils.runOnUiThreadBlocking(new Callable<String>() { 368 return ThreadUtils.runOnUiThreadBlocking(new Callable<String>() {
344 @Override 369 @Override
345 public String call() { 370 public String call() {
346 return ((OptionSection) mUI.getContactDetailsSectionForTest()) 371 return ((OptionSection) mUI.getContactDetailsSectionForTest())
347 .getOptionLabelsForTest(suggestionIndex) 372 .getOptionLabelsForTest(suggestionIndex)
348 .getText() 373 .getText()
349 .toString(); 374 .toString();
350 } 375 }
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 } 983 }
959 984
960 public interface PaymentRequestTestCommonCallback { 985 public interface PaymentRequestTestCommonCallback {
961 ChromeTabbedActivity getActivity(); 986 ChromeTabbedActivity getActivity();
962 void onMainActivityStarted() 987 void onMainActivityStarted()
963 throws InterruptedException, ExecutionException, TimeoutExceptio n; 988 throws InterruptedException, ExecutionException, TimeoutExceptio n;
964 void startMainActivityWithURL(String url) throws InterruptedException; 989 void startMainActivityWithURL(String url) throws InterruptedException;
965 void assertWaitForPageScaleFactorMatch(float expectedScale); 990 void assertWaitForPageScaleFactorMatch(float expectedScale);
966 } 991 }
967 } 992 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698