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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java

Issue 2979853002: Reland of customtabs: Remove unnecessary Context plumbing. (Closed)
Patch Set: Created 3 years, 5 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 92d4c3b3d7730a06072781bcbb0f6f2bf1bd6a48..36770050671192f88b1dcfc04349dd1f5ef01372 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
@@ -8,7 +8,6 @@
import static org.chromium.chrome.browser.customtabs.CustomTabActivityTestRule.LONG_TIMEOUT_MS;
import android.app.Activity;
-import android.app.Application;
import android.app.Instrumentation;
import android.app.Instrumentation.ActivityMonitor;
import android.app.Instrumentation.ActivityResult;
@@ -205,18 +204,13 @@
LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized();
mWebServer = TestWebServer.start();
- CustomTabsConnection connection =
- CustomTabsConnection.getInstance((Application) appContext);
+ CustomTabsConnection connection = CustomTabsConnection.getInstance();
connection.setForcePrerender(true);
}
@After
public void tearDown() throws Exception {
- Context appContext = InstrumentationRegistry.getInstrumentation()
- .getTargetContext()
- .getApplicationContext();
- CustomTabsConnection connection =
- CustomTabsConnection.getInstance((Application) appContext);
+ CustomTabsConnection connection = CustomTabsConnection.getInstance();
connection.setForcePrerender(false);
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@@ -1012,7 +1006,7 @@
final Intent intent = CustomTabsTestUtils.createMinimalCustomTabIntent(context, mTestPage2);
final CustomTabsSessionToken session = warmUpAndLaunchUrlWithSession(intent);
Assert.assertEquals(getActivity().getIntentDataProvider().getSession(), session);
- CustomTabsConnection connection = CustomTabsConnection.getInstance((Application) context);
+ CustomTabsConnection connection = CustomTabsConnection.getInstance();
String packageName = context.getPackageName();
final String referrer =
IntentHandler.constructValidReferrerForAuthority(packageName).getUrl();
@@ -2191,8 +2185,7 @@
Context context = InstrumentationRegistry.getInstrumentation()
.getTargetContext()
.getApplicationContext();
- final CustomTabsConnection connection =
- CustomTabsConnection.getInstance((Application) context);
+ final CustomTabsConnection connection = CustomTabsConnection.getInstance();
CustomTabsSessionToken token = CustomTabsSessionToken.createDummySessionTokenForTesting();
connection.newSession(token);
@@ -2681,8 +2674,7 @@
Context context = InstrumentationRegistry.getInstrumentation()
.getTargetContext()
.getApplicationContext();
- CustomTabsConnection connection =
- CustomTabsTestUtils.setUpConnection((Application) context);
+ CustomTabsConnection connection = CustomTabsTestUtils.setUpConnection();
CustomTabsSessionToken token = CustomTabsSessionToken.createDummySessionTokenForTesting();
connection.newSession(token);
Bundle extras = null;
@@ -2704,11 +2696,7 @@
}
private CustomTabsConnection warmUpAndWait() {
- final Context context = InstrumentationRegistry.getInstrumentation()
- .getTargetContext()
- .getApplicationContext();
- CustomTabsConnection connection =
- CustomTabsTestUtils.setUpConnection((Application) context);
+ CustomTabsConnection connection = CustomTabsTestUtils.setUpConnection();
final CallbackHelper startupCallbackHelper = new CallbackHelper();
Assert.assertTrue(connection.warmup(0));
ThreadUtils.runOnUiThread(new Runnable() {

Powered by Google App Engine
This is Rietveld 408576698