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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/InterfaceRegistryTest.java

Issue 2247143004: Remove app context init from LibraryLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing setUp calls. Created 4 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
Index: content/public/android/javatests/src/org/chromium/content/browser/InterfaceRegistryTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/InterfaceRegistryTest.java b/content/public/android/javatests/src/org/chromium/content/browser/InterfaceRegistryTest.java
index 9adf51bdda16ff8b8971445e3ecee571066ef64c..5dee06e78514ba42791bf1e720d0e1fd3e5ace6a 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/InterfaceRegistryTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/InterfaceRegistryTest.java
@@ -4,8 +4,10 @@
package org.chromium.content.browser;
+import android.content.Context;
import android.test.suitebuilder.annotation.SmallTest;
+import org.chromium.base.ContextUtils;
import org.chromium.base.library_loader.LibraryLoader;
import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.content.browser.InterfaceRegistry.ImplementationFactory;
@@ -29,7 +31,7 @@ public class InterfaceRegistryTest extends ContentShellTestBase {
private static final long RUN_LOOP_TIMEOUT_MS = 25;
- private final List<Closeable> mCloseablesToClose = new ArrayList<Closeable>();
+ private final List<Closeable> mCloseablesToClose = new ArrayList<>();
private long mNativeTestEnvironment;
static class CalcConnectionErrorHandler implements ConnectionErrorHandler {
@@ -97,8 +99,9 @@ public class InterfaceRegistryTest extends ContentShellTestBase {
@Override
protected void setUp() throws Exception {
super.setUp();
- LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized(
- getInstrumentation().getTargetContext());
+ Context appContext = getInstrumentation().getTargetContext().getApplicationContext();
+ ContextUtils.initApplicationContext(appContext);
+ LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized(appContext);
launchContentShellWithUrl("about://blank");
mNativeTestEnvironment = ShellMojoTestUtils.setupTestEnvironment();
}

Powered by Google App Engine
This is Rietveld 408576698