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

Unified Diff: content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.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/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
diff --git a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
index 186f77a8dc671894e9289567dde21be54c2e0315..58508ea529a43dc5bd815f4b28065646d521afad 100644
--- a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
+++ b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellTestBase.java
@@ -22,6 +22,8 @@ import org.chromium.content.browser.test.util.Criteria;
import org.chromium.content.browser.test.util.CriteriaHelper;
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_public.browser.WebContents;
import org.chromium.content_shell.Shell;
import java.lang.annotation.ElementType;
@@ -112,6 +114,13 @@ public class ContentShellTestBase extends ActivityInstrumentationTestCase2<Conte
}
/**
+ * Returns the WebContents of this Shell.
+ */
+ protected WebContents getWebContents() {
+ return getActivity().getActiveShell().getWebContents();
+ }
+
+ /**
* Waits for the Active shell to finish loading. This times out after
* WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT milliseconds and it shouldn't be used for long
* loading pages. Instead it should be used more for test initialization. The proper way
@@ -162,14 +171,15 @@ public class ContentShellTestBase extends ActivityInstrumentationTestCase2<Conte
* @param params The URL params to use.
*/
protected void loadUrl(
- final ContentViewCore viewCore, TestCallbackHelperContainer callbackHelperContainer,
+ final NavigationController navigationController,
+ TestCallbackHelperContainer callbackHelperContainer,
final LoadUrlParams params) throws Throwable {
handleBlockingCallbackAction(
callbackHelperContainer.getOnPageFinishedHelper(),
new Runnable() {
@Override
public void run() {
- viewCore.getWebContents().getNavigationController().loadUrl(params);
+ navigationController.loadUrl(params);
}
});
}

Powered by Google App Engine
This is Rietveld 408576698