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

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

Issue 2611883002: Prepare to call GMS APIs from WebView (Closed)
Patch Set: explicit destructor for style checker 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..a0ce79258c0bc1371d46c89951fdd78220f55b23 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,18 @@ 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);
+ 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
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/AwStrictModeTest.java ('k') | android_webview/native/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698