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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.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: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
index 2e5b34cb231d90f5f8fea76734c6fc6cf2850a83..e2d213470ef0e04b7e0b35a809beb96dffa70722 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java
@@ -40,6 +40,7 @@ import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageButton;
+import org.chromium.base.ContextUtils;
import org.chromium.base.PathUtils;
import org.chromium.base.ThreadUtils;
import org.chromium.base.library_loader.LibraryLoader;
@@ -114,14 +115,14 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
@Override
protected void setUp() throws Exception {
super.setUp();
+ Context appContext = getInstrumentation().getTargetContext().getApplicationContext();
+ ContextUtils.initApplicationContext(appContext);
mTestServer = EmbeddedTestServer.createAndStartFileServer(
- getInstrumentation().getContext(), Environment.getExternalStorageDirectory());
+ appContext, Environment.getExternalStorageDirectory());
mTestPage = mTestServer.getURL(TEST_PAGE);
mTestPage2 = mTestServer.getURL(TEST_PAGE_2);
- PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX,
- getInstrumentation().getTargetContext().getApplicationContext());
- LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER)
- .ensureInitialized(getInstrumentation().getTargetContext().getApplicationContext());
+ PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, appContext);
+ LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized(appContext);
}
@Override
@@ -164,7 +165,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
private PendingIntent addMenuEntriesToIntent(Intent intent, int numEntries) {
PendingIntent pi = PendingIntent.getBroadcast(getInstrumentation().getTargetContext(), 0,
new Intent(), 0);
- ArrayList<Bundle> menuItems = new ArrayList<Bundle>();
+ ArrayList<Bundle> menuItems = new ArrayList<>();
for (int i = 0; i < numEntries; i++) {
Bundle bundle = new Bundle();
bundle.putString(CustomTabsIntent.KEY_MENU_ITEM_TITLE, TEST_MENU_TITLE);

Powered by Google App Engine
This is Rietveld 408576698