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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.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/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java
index 231319015ec72b25164b7dcb6cf22b46703c217d..825be84d322195f7428ccff80844b152090fdbbd 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewTestBase.java
@@ -9,6 +9,7 @@ import android.util.Log;
import org.chromium.base.test.util.UrlUtils;
import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
import org.chromium.content_public.browser.LoadUrlParams;
+import org.chromium.content_public.browser.NavigationController;
import org.chromium.content_shell_apk.ContentShellActivity;
import org.chromium.content_shell_apk.ContentShellTestBase;
@@ -42,8 +43,9 @@ public class ContentViewTestBase extends ContentShellTestBase {
}
});
- loadDataSync(activity.getActiveContentViewCore(),
- "<!DOCTYPE html><title></title>", "text/html", false);
+ loadDataSync(activity.getActiveContentViewCore().getWebContents()
+ .getNavigationController(), "<!DOCTYPE html><title></title>", "text/html",
+ false);
} catch (Throwable e) {
throw new RuntimeException(
"Failed to set up ContentView: " + Log.getStackTraceString(e));
@@ -54,9 +56,9 @@ public class ContentViewTestBase extends ContentShellTestBase {
* Loads data on the UI thread and blocks until onPageFinished is called.
* TODO(cramya): Move method to a separate util file once UiUtils.java moves into base.
*/
- protected void loadDataSync(final ContentViewCore contentViewCore, final String data,
+ protected void loadDataSync(final NavigationController navigationController, final String data,
final String mimeType, final boolean isBase64Encoded) throws Throwable {
- loadUrl(contentViewCore, mTestCallbackHelperContainer, LoadUrlParams.createLoadDataParams(
- data, mimeType, isBase64Encoded));
+ loadUrl(navigationController, mTestCallbackHelperContainer,
+ LoadUrlParams.createLoadDataParams(data, mimeType, isBase64Encoded));
}
}

Powered by Google App Engine
This is Rietveld 408576698