Index: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java |
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java |
index 80556b6166e8c3c52e4184b8c098fd9302babdf9..daefd4f60ad52d8cd6ca01452632593436cd0e30 100644 |
--- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java |
+++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/JavaScriptUtils.java |
@@ -10,6 +10,7 @@ import junit.framework.Assert; |
import org.chromium.base.ThreadUtils; |
import org.chromium.content.browser.ContentViewCore; |
+import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper; |
import java.util.concurrent.TimeUnit; |
import java.util.concurrent.TimeoutException; |
@@ -25,10 +26,9 @@ public class JavaScriptUtils { |
* Returns the result of its execution in JSON format. |
*/ |
public static String executeJavaScriptAndWaitForResult( |
- final ContentViewCore viewCore, TestCallbackHelperContainer viewClient, |
- final String code) throws InterruptedException, TimeoutException { |
+ ContentViewCore viewCore, String code) throws InterruptedException, TimeoutException { |
return executeJavaScriptAndWaitForResult( |
- viewCore, viewClient.getOnEvaluateJavaScriptResultHelper(), code); |
+ viewCore, code, EVALUATION_TIMEOUT_SECONDS, TimeUnit.SECONDS); |
} |
/** |
@@ -38,23 +38,11 @@ public class JavaScriptUtils { |
*/ |
public static String executeJavaScriptAndWaitForResult( |
final ContentViewCore viewCore, |
- final TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper helper, |
- final String code) throws InterruptedException, TimeoutException { |
- return executeJavaScriptAndWaitForResult( |
- viewCore, helper, code, EVALUATION_TIMEOUT_SECONDS, TimeUnit.SECONDS); |
- } |
- |
- /** |
- * Executes the given snippet of JavaScript code within the given ContentViewCore. |
- * Does not depend on ContentView and TestCallbackHelperContainer. |
- * Returns the result of its execution in JSON format. |
- */ |
- public static String executeJavaScriptAndWaitForResult( |
- final ContentViewCore viewCore, |
- final TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper helper, |
final String code, |
- final long timeout, final TimeUnit timeoutUnits) |
+ final long timeout, |
+ final TimeUnit timeoutUnits) |
throws InterruptedException, TimeoutException { |
+ final OnEvaluateJavaScriptResultHelper helper = new OnEvaluateJavaScriptResultHelper(); |
// Calling this from the UI thread causes it to time-out: the UI thread being blocked won't |
// have a chance to process the JavaScript eval response). |
Assert.assertFalse("Executing JavaScript should be done from the test thread, " |