Index: android_webview/java/src/org/chromium/android_webview/AwContents.java |
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
index 3b7a1654a3c6bef5b674c891f1e32949adcafc86..8874bd7375ea74006664616fe1e7e41e5c7d1327 100644 |
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java |
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java |
@@ -2069,6 +2069,22 @@ public class AwContents implements SmartClipProvider, |
mWebContents.evaluateJavaScript(script, jsCallback); |
} |
+ public void evaluateJavaScriptForTests(String script, final ValueCallback<String> callback) { |
+ if (TRACE) Log.d(TAG, "evaluateJavascriptForTests=" + script); |
+ if (isDestroyed()) return; |
+ JavaScriptCallback jsCallback = null; |
+ if (callback != null) { |
+ jsCallback = new JavaScriptCallback() { |
+ @Override |
+ public void handleJavaScriptResult(String jsonResult) { |
+ callback.onReceiveValue(jsonResult); |
+ } |
+ }; |
+ } |
+ |
+ mWebContents.evaluateJavaScriptForTests(script, jsCallback); |
+ } |
+ |
/** |
* Post a message to a frame. |
* |