Index: android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java |
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java |
index 993e988967015c8fa11c6b75d6ce8e46eccc86cc..61d9dd91747ba7a2df0f8b71fca3dceb8c5a2c0e 100644 |
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java |
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java |
@@ -4,14 +4,14 @@ |
package org.chromium.android_webview.test; |
+import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
+ |
import android.app.Instrumentation; |
import android.content.Context; |
import android.graphics.Bitmap; |
import android.os.Build; |
import android.util.Log; |
-import static org.chromium.base.test.util.ScalableTimeout.scaleTimeout; |
- |
import org.chromium.android_webview.AwBrowserContext; |
import org.chromium.android_webview.AwBrowserProcess; |
import org.chromium.android_webview.AwContents; |
@@ -20,6 +20,7 @@ import org.chromium.android_webview.AwSettings; |
import org.chromium.android_webview.AwSwitches; |
import org.chromium.android_webview.test.util.GraphicsTestUtils; |
import org.chromium.android_webview.test.util.JSUtils; |
+import org.chromium.base.ContextUtils; |
import org.chromium.base.ThreadUtils; |
import org.chromium.base.test.BaseActivityInstrumentationTestCase; |
import org.chromium.base.test.util.CommandLineFlags; |
@@ -79,10 +80,11 @@ public class AwTestBase |
@Override |
protected void setUp() throws Exception { |
- mBrowserContext = new AwBrowserContext( |
- new InMemorySharedPreferences(), getInstrumentation().getTargetContext()); |
+ Context appContext = getInstrumentation().getTargetContext().getApplicationContext(); |
+ mBrowserContext = new AwBrowserContext(new InMemorySharedPreferences(), appContext); |
super.setUp(); |
+ ContextUtils.initApplicationContext(appContext); |
if (needsBrowserProcessStarted()) { |
startBrowserProcess(); |
} |
@@ -98,8 +100,10 @@ public class AwTestBase |
}); |
} |
- /* Override this to return false if the test doesn't want the browser startup sequence to |
+ /** |
+ * Override this to return false if the test doesn't want the browser startup sequence to |
* be run automatically. |
+ * @return Whether the instrumentation test requires the browser process to already be started. |
*/ |
protected boolean needsBrowserProcessStarted() { |
return true; |