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

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

Issue 2628863004: [Android WebView] Ensure we have user consent before uploading minidumps (Closed)
Patch Set: Created 3 years, 11 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: 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 d37e9b403167ac66b2eb8782a79de154787a64a8..a05ec32afaac7a79b974234bd75a71014273d251 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
@@ -98,12 +98,19 @@ public class AwTestBase
if (mBrowserContext != null) {
throw new AndroidRuntimeException("There should only be one browser context.");
}
- Context appContext = getInstrumentation().getTargetContext().getApplicationContext();
- mBrowserContext = new AwBrowserContext(new InMemorySharedPreferences(), appContext);
+ getActivity(); // The Activity must be launched in order to load native code.
+ final InMemorySharedPreferences prefs = new InMemorySharedPreferences();
+ final Context appContext = getInstrumentation().getTargetContext().getApplicationContext();
+ getInstrumentation().runOnMainSync(new Runnable() {
+ @Override
+ public void run() {
+ mBrowserContext = new AwBrowserContext(prefs, appContext);
+ }
+ });
}
protected void startBrowserProcess() throws Exception {
- // The activity must be launched in order for proper webview statics to be setup.
+ // The Activity must be launched in order for proper webview statics to be setup.
getActivity();
getInstrumentation().runOnMainSync(new Runnable() {
@Override

Powered by Google App Engine
This is Rietveld 408576698