diff options
2 files changed, 18 insertions, 11 deletions
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java index 900c025..e2594d1 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidWebViewLoadUrlTest.java @@ -19,16 +19,6 @@ import java.util.concurrent.Callable; * Test suite for loadUrl(). */ public class AndroidWebViewLoadUrlTest extends AndroidWebViewTestBase { - - private String getTitleOnUiThread(final ContentViewCore contentViewCore) throws Throwable { - return runTestOnUiThreadAndGetResult(new Callable<String>() { - @Override - public String call() throws Exception { - return contentViewCore.getTitle(); - } - }); - } - @SmallTest @Feature({"Android-WebView"}) public void testDataUrl() throws Throwable { 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 d375b32..906204b 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(); + } + }); + } } |