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;
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (url != null) intent.setData(Uri.parse(url));
intent.setComponent(new ComponentName(getInstrumentation().getTargetContext(),
- ContentShellActivity.class));
+ ContentShellActivity.class));
if (commandLineArgs != null) {
intent.putExtra(ContentShellActivity.COMMAND_LINE_ARGS_KEY, commandLineArgs);
}
}
/**
+ * 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
* @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);
}
});
}