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

Unified Diff: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java

Issue 572013002: Removing ContentViewCore dependencies from direct WebContents functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the patch and addressed review comments. Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java
index b1bc80ba9602ff3fa773db9fca4b05f896d86d4e..2d854ef0c9cc96cb67736efffe8c6c08356cd18a 100644
--- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java
+++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestCallbackHelperContainer.java
@@ -8,6 +8,7 @@ package org.chromium.content.browser.test.util;
import org.chromium.base.ThreadUtils;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content_public.browser.JavaScriptCallback;
+import org.chromium.content_public.browser.WebContents;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
@@ -28,7 +29,8 @@ public class TestCallbackHelperContainer {
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- mTestWebContentsObserver = new TestWebContentsObserver(contentViewCore);
+ mTestWebContentsObserver = new TestWebContentsObserver(contentViewCore
+ .getWebContents());
}
});
}
@@ -105,11 +107,11 @@ public class TestCallbackHelperContainer {
private String mJsonResult;
/**
- * Starts evaluation of a given JavaScript code on a given contentViewCore.
- * @param contentViewCore A ContentViewCore instance to be used.
+ * Starts evaluation of a given JavaScript code on a given webContents.
+ * @param webContents A WebContents instance to be used.
* @param code A JavaScript code to be evaluated.
*/
- public void evaluateJavaScript(ContentViewCore contentViewCore, String code) {
+ public void evaluateJavaScript(WebContents webContents, String code) {
JavaScriptCallback callback =
new JavaScriptCallback() {
@Override
@@ -117,7 +119,7 @@ public class TestCallbackHelperContainer {
notifyCalled(jsonResult);
}
};
- contentViewCore.evaluateJavaScript(code, callback);
+ webContents.evaluateJavaScript(code, callback);
mJsonResult = null;
}

Powered by Google App Engine
This is Rietveld 408576698