| Index: android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
|
| diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
|
| index 306be04687e7d03ee9ff5eaba1d10aae9d851bd6..4f35e75a63bac353b2110bc1f6acf7e05fd09516 100644
|
| --- a/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
|
| +++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/JSUtils.java
|
| @@ -4,11 +4,11 @@
|
|
|
| package org.chromium.android_webview.test.util;
|
|
|
| -import android.test.InstrumentationTestCase;
|
| +import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
|
|
|
| -import junit.framework.Assert;
|
| +import android.app.Instrumentation;
|
|
|
| -import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout;
|
| +import org.junit.Assert;
|
|
|
| import org.chromium.android_webview.AwContents;
|
| import org.chromium.content.browser.test.util.Criteria;
|
| @@ -22,18 +22,16 @@ public class JSUtils {
|
| private static final long WAIT_TIMEOUT_MS = scaleTimeout(2000);
|
| private static final int CHECK_INTERVAL = 100;
|
|
|
| - public static void clickOnLinkUsingJs(
|
| - final InstrumentationTestCase testCase,
|
| + public static void clickOnLinkUsingJs(final Instrumentation instrumentation,
|
| final AwContents awContents,
|
| final OnEvaluateJavaScriptResultHelper onEvaluateJavaScriptResultHelper,
|
| final String linkId) throws Exception {
|
| -
|
| CriteriaHelper.pollInstrumentationThread(new Criteria() {
|
| @Override
|
| public boolean isSatisfied() {
|
| try {
|
| - String linkIsNotNull = executeJavaScriptAndWaitForResult(testCase, awContents,
|
| - onEvaluateJavaScriptResultHelper,
|
| + String linkIsNotNull = executeJavaScriptAndWaitForResult(instrumentation,
|
| + awContents, onEvaluateJavaScriptResultHelper,
|
| "document.getElementById('" + linkId + "') != null");
|
| return linkIsNotNull.equals("true");
|
| } catch (Throwable t) {
|
| @@ -44,7 +42,7 @@ public class JSUtils {
|
| }
|
| }, WAIT_TIMEOUT_MS, CHECK_INTERVAL);
|
|
|
| - testCase.getInstrumentation().runOnMainSync(new Runnable() {
|
| + instrumentation.runOnMainSync(new Runnable() {
|
| @Override
|
| public void run() {
|
| awContents.getWebContents().evaluateJavaScriptForTests(
|
| @@ -56,12 +54,11 @@ public class JSUtils {
|
| });
|
| }
|
|
|
| - public static String executeJavaScriptAndWaitForResult(
|
| - InstrumentationTestCase testCase,
|
| + public static String executeJavaScriptAndWaitForResult(Instrumentation instrumentation,
|
| final AwContents awContents,
|
| final OnEvaluateJavaScriptResultHelper onEvaluateJavaScriptResultHelper,
|
| final String code) throws Exception {
|
| - testCase.getInstrumentation().runOnMainSync(new Runnable() {
|
| + instrumentation.runOnMainSync(new Runnable() {
|
| @Override
|
| public void run() {
|
| onEvaluateJavaScriptResultHelper.evaluateJavaScriptForTests(
|
|
|