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

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

Issue 1954363002: Start using the third_party/custom_tabs_client as support lib source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 7 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/CustomTabsTestUtils.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.java
index 20ba857cd1f70eb646d830a32b857b8d4419bda8..5553294dc899601033fc40ffcfd3b53cdc577385 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabsTestUtils.java
@@ -9,44 +9,32 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
-import android.os.Bundle;
-import android.os.IBinder;
import android.os.Process;
import android.support.customtabs.CustomTabsIntent;
-import android.support.customtabs.ICustomTabsCallback;
+import android.support.customtabs.CustomTabsSession;
import org.chromium.base.ThreadUtils;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
-import org.chromium.chrome.browser.util.IntentUtils;
/**
* Utility class that contains convenience calls related with custom tabs testing.
*/
public class CustomTabsTestUtils {
- /** Dummy callback, doing nothing. */
- public static class DummyCallback extends ICustomTabsCallback.Stub {
- @Override
- public void onNavigationEvent(int navigationEvent, Bundle extras) {}
-
- @Override
- public void extraCallback(String callbackName, Bundle args) {}
-
- @Override
- public IBinder asBinder() {
- return this;
- }
- }
/**
* Creates the simplest intent that is sufficient to let {@link ChromeLauncherActivity} launch
* the {@link CustomTabActivity}.
*/
public static Intent createMinimalCustomTabIntent(
- Context context, String url, IBinder session) {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+ Context context, String url) {
+ CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(
+ CustomTabsSession.createDummySessionForTesting(
+ new ComponentName(context, ChromeLauncherActivity.class)));
+ CustomTabsIntent customTabsIntent = builder.build();
+ Intent intent = customTabsIntent.intent;
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.setData(Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- intent.setComponent(new ComponentName(context, ChromeLauncherActivity.class));
- IntentUtils.safePutBinderExtra(intent, CustomTabsIntent.EXTRA_SESSION, session);
return intent;
}

Powered by Google App Engine
This is Rietveld 408576698