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

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java

Issue 10908014: [Android] Refactor AndroidWebViewTestBase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 8 years, 4 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
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java
index d375b32ac17f6aecd590ba0172b0dffb9593041f..906204bbd0ccc39e1713bebf778adcdc8f982fea 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewTestBase.java
@@ -35,6 +35,8 @@ import java.util.concurrent.TimeoutException;
public class AndroidWebViewTestBase
extends ActivityInstrumentationTestCase2<AndroidWebViewTestRunnerActivity> {
protected static int WAIT_TIMEOUT_SECONDS = 15;
+ protected static final boolean NORMAL_VIEW = false;
+ protected static final boolean INCOGNITO_VIEW = true;
public AndroidWebViewTestBase() {
super(AndroidWebViewTestRunnerActivity.class);
@@ -149,15 +151,30 @@ public class AndroidWebViewTestBase
protected AwTestContainerView createAwTestContainerViewOnMainSync(
final AwContentsClient client) throws Exception {
+ return createAwTestContainerViewOnMainSync(NORMAL_VIEW, client);
+ }
+
+ protected AwTestContainerView createAwTestContainerViewOnMainSync(
+ final boolean incognito,
+ final AwContentsClient client) throws Exception {
final AtomicReference<AwTestContainerView> testContainerView =
new AtomicReference<AwTestContainerView>();
final Context context = getActivity();
getInstrumentation().runOnMainSync(new Runnable() {
@Override
public void run() {
- testContainerView.set(createAwTestContainerView(false, client));
+ testContainerView.set(createAwTestContainerView(incognito, client));
}
});
return testContainerView.get();
}
+
+ protected String getTitleOnUiThread(final ContentViewCore contentViewCore) throws Throwable {
+ return runTestOnUiThreadAndGetResult(new Callable<String>() {
+ @Override
+ public String call() throws Exception {
+ return contentViewCore.getTitle();
+ }
+ });
+ }
}
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698