| 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.widget.EditText; | 7 import android.widget.EditText; |
| 8 import android.widget.TextView; | 8 import android.widget.TextView; |
| 9 | 9 |
| 10 import org.chromium.base.ThreadUtils; | 10 import org.chromium.base.ThreadUtils; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 helper.waitForCallback(callCount); | 133 helper.waitForCallback(callCount); |
| 134 } | 134 } |
| 135 | 135 |
| 136 /** Clicks on an element in the editor UI. */ | 136 /** Clicks on an element in the editor UI. */ |
| 137 protected void clickInEditorAndWait(final int resourceId, CallbackHelper hel
per) | 137 protected void clickInEditorAndWait(final int resourceId, CallbackHelper hel
per) |
| 138 throws InterruptedException, TimeoutException { | 138 throws InterruptedException, TimeoutException { |
| 139 int callCount = helper.getCallCount(); | 139 int callCount = helper.getCallCount(); |
| 140 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 140 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 141 @Override | 141 @Override |
| 142 public void run() { | 142 public void run() { |
| 143 mUI.getEditorView().findViewById(resourceId).performClick(); | 143 mUI.getEditorViewForTest().findViewById(resourceId).performClick
(); |
| 144 } | 144 } |
| 145 }); | 145 }); |
| 146 helper.waitForCallback(callCount); | 146 helper.waitForCallback(callCount); |
| 147 } | 147 } |
| 148 | 148 |
| 149 /** Clicks on a button in the card unmask UI. */ | 149 /** Clicks on a button in the card unmask UI. */ |
| 150 protected void clickCardUnmaskButtonAndWait(final int dialogButtonId, Callba
ckHelper helper) | 150 protected void clickCardUnmaskButtonAndWait(final int dialogButtonId, Callba
ckHelper helper) |
| 151 throws InterruptedException, TimeoutException { | 151 throws InterruptedException, TimeoutException { |
| 152 int callCount = helper.getCallCount(); | 152 int callCount = helper.getCallCount(); |
| 153 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 153 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 169 } | 169 } |
| 170 }); | 170 }); |
| 171 } | 171 } |
| 172 | 172 |
| 173 /** Directly sets the text in the editor UI. */ | 173 /** Directly sets the text in the editor UI. */ |
| 174 protected void setTextInEditor(final int resourceId, final String input) | 174 protected void setTextInEditor(final int resourceId, final String input) |
| 175 throws InterruptedException, TimeoutException { | 175 throws InterruptedException, TimeoutException { |
| 176 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 176 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 177 @Override | 177 @Override |
| 178 public void run() { | 178 public void run() { |
| 179 ((EditText) mUI.getEditorView().findViewById(resourceId)).setTex
t(input); | 179 ((EditText) mUI.getEditorViewForTest().findViewById(resourceId))
.setText(input); |
| 180 } | 180 } |
| 181 }); | 181 }); |
| 182 } | 182 } |
| 183 | 183 |
| 184 /** Directly sets the text in the card unmask UI. */ | 184 /** Directly sets the text in the card unmask UI. */ |
| 185 protected void setTextInCardUnmaskDialogAndWait(final int resourceId, final
String input, | 185 protected void setTextInCardUnmaskDialogAndWait(final int resourceId, final
String input, |
| 186 CallbackHelper helper) throws InterruptedException, TimeoutException
{ | 186 CallbackHelper helper) throws InterruptedException, TimeoutException
{ |
| 187 int callCount = helper.getCallCount(); | 187 int callCount = helper.getCallCount(); |
| 188 ThreadUtils.runOnUiThreadBlocking(new Runnable() { | 188 ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| 189 @Override | 189 @Override |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 * | 312 * |
| 313 * @param ui The UI that is ready for input. | 313 * @param ui The UI that is ready for input. |
| 314 */ | 314 */ |
| 315 public void notifyCalled(T target) { | 315 public void notifyCalled(T target) { |
| 316 ThreadUtils.assertOnUiThread(); | 316 ThreadUtils.assertOnUiThread(); |
| 317 mTarget = target; | 317 mTarget = target; |
| 318 notifyCalled(); | 318 notifyCalled(); |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 } | 321 } |
| OLD | NEW |