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

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

Issue 2247143004: Remove app context init from LibraryLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix per review. Created 4 years, 3 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/test/android/javatests/src/org/chromium/content/browser/test/NativeLibraryTestBase.java
diff --git a/content/public/test/android/javatests/src/org/chromium/content/browser/test/NativeLibraryTestBase.java b/content/public/test/android/javatests/src/org/chromium/content/browser/test/NativeLibraryTestBase.java
index 7a5d4bba156092e5cfc48fe8a78982d903e3b18a..15bbae9e853a96279495f6490570ab2e5f932141 100644
--- a/content/public/test/android/javatests/src/org/chromium/content/browser/test/NativeLibraryTestBase.java
+++ b/content/public/test/android/javatests/src/org/chromium/content/browser/test/NativeLibraryTestBase.java
@@ -6,6 +6,7 @@ package org.chromium.content.browser.test;
import android.test.InstrumentationTestCase;
+import org.chromium.base.ContextUtils;
import org.chromium.base.PathUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.library_loader.LibraryLoader;
@@ -39,7 +40,7 @@ public class NativeLibraryTestBase extends InstrumentationTestCase {
assertFalse(ThreadUtils.runningOnUiThread());
PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX,
- getInstrumentation().getTargetContext());
+ ContextUtils.getApplicationContext());
try {
ApplicationUtils.waitForLibraryDependencies(getInstrumentation());
@@ -61,15 +62,14 @@ public class NativeLibraryTestBase extends InstrumentationTestCase {
private void nativeInitialization(boolean initBrowserProcess) {
if (initBrowserProcess) {
try {
- BrowserStartupController.get(getInstrumentation().getTargetContext(),
+ BrowserStartupController.get(ContextUtils.getApplicationContext(),
LibraryProcessType.PROCESS_BROWSER).startBrowserProcessesSync(false);
} catch (ProcessInitException e) {
throw new Error(e);
}
} else {
try {
- LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER)
- .ensureInitialized(getInstrumentation().getTargetContext());
+ LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized();
} catch (ProcessInitException e) {
throw new Error(e);
}

Powered by Google App Engine
This is Rietveld 408576698