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

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

Issue 1276993002: Revert of Add custom tabs tests using intents with non-null sessions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTestBase.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a6726155e1c3434a4a8d636a07e5f0fe66a9592c..17bbb58b31c86826bfcc297449f279775ee73c14 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
@@ -4,7 +4,6 @@
package org.chromium.chrome.browser.customtabs;
-import android.app.Application;
import android.app.Instrumentation;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
@@ -16,9 +15,7 @@
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.os.Bundle;
-import android.os.IBinder;
import android.support.customtabs.CustomTabsIntent;
-import android.support.customtabs.ICustomTabsCallback;
import android.test.suitebuilder.annotation.SmallTest;
import android.view.Menu;
import android.view.MenuItem;
@@ -40,7 +37,6 @@
import org.chromium.content.browser.test.util.CriteriaHelper;
import java.util.ArrayList;
-import java.util.concurrent.Callable;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -72,8 +68,6 @@
TEST_ACTION = "org.chromium.chrome.browser.customtabs.TEST_PENDING_INTENT_SENT";
private static final String TEST_PAGE = TestHttpServerClient.getUrl(
"chrome/test/data/android/google.html");
- private static final String TEST_PAGE_2 = TestHttpServerClient.getUrl(
- "chrome/test/data/android/test.html");
private static final String TEST_MENU_TITLE = "testMenuTitle";
private CustomTabActivity mActivity;
@@ -85,11 +79,10 @@
}
/**
- * @see CustomTabsTestUtils#createMinimalCustomTabIntent(Context, String, IBinder).
+ * @see CustomTabActivityTestBase#createMinimalCustomTabIntent(String)
*/
private Intent createMinimalCustomTabIntent() {
- return CustomTabsTestUtils.createMinimalCustomTabIntent(
- getInstrumentation().getTargetContext(), TEST_PAGE, null);
+ return createMinimalCustomTabIntent(TEST_PAGE);
}
/**
@@ -375,61 +368,6 @@
assertNull(dataProvider.getActionButtonPendingIntentForTest());
}
- @SmallTest
- public void testLaunchWithSession() throws InterruptedException {
- IBinder session = warmUpAndLaunchUrlWithSession();
- assertEquals(mActivity.getIntentDataProvider().getSession(), session);
- }
-
- @SmallTest
- public void testLoadNewUrlWithSession() throws InterruptedException {
- final IBinder session = warmUpAndLaunchUrlWithSession();
- final Context context = getInstrumentation().getTargetContext();
- assertEquals(mActivity.getIntentDataProvider().getSession(), session);
- assertFalse("CustomTabContentHandler handled intent with wrong session",
- ThreadUtils.runOnUiThreadBlockingNoException(new Callable<Boolean>() {
- @Override
- public Boolean call() throws Exception {
- return CustomTabActivity.handleInActiveContentIfNeeded(
- CustomTabsTestUtils.createMinimalCustomTabIntent(context,
- TEST_PAGE_2,
- CustomTabsTestUtils.newDummyCallback().asBinder()));
- }
- }));
- assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {
- @Override
- public boolean isSatisfied() {
- return mActivity.getActivityTab().getUrl().equals(TEST_PAGE);
- }
- }));
- assertTrue("CustomTabContentHandler can't handle intent with same session",
- ThreadUtils.runOnUiThreadBlockingNoException(new Callable<Boolean>() {
- @Override
- public Boolean call() throws Exception {
- return CustomTabActivity.handleInActiveContentIfNeeded(
- CustomTabsTestUtils.createMinimalCustomTabIntent(context,
- TEST_PAGE_2, session));
- }
- }));
- assertTrue(CriteriaHelper.pollForCriteria(new Criteria() {
- @Override
- public boolean isSatisfied() {
- return mActivity.getActivityTab().getUrl().equals(TEST_PAGE_2);
- }
- }));
- }
-
- private IBinder warmUpAndLaunchUrlWithSession() throws InterruptedException {
- Context context = getInstrumentation().getTargetContext().getApplicationContext();
- CustomTabsConnection connection = CustomTabsConnection.getInstance((Application) context);
- ICustomTabsCallback callback = CustomTabsTestUtils.newDummyCallback();
- connection.warmup(0);
- connection.newSession(callback);
- startCustomTabActivityWithIntent(CustomTabsTestUtils.createMinimalCustomTabIntent(
- context, TEST_PAGE, callback.asBinder()));
- return callback.asBinder();
- }
-
/**
* A helper class to monitor sending status of a {@link PendingIntent}.
*/
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTestBase.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698