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

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

Issue 2393993005: Revert "[Custom Tabs] Implement "Read It Later" Behind a Flag" (Closed)
Patch Set: compile Created 4 years, 2 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 1b3b0376e4019eacd7d4bc897d510d6beee9d47e..2eecedff42b3fc1bf4e637060e0c04f518557775 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
@@ -49,7 +49,6 @@ import org.chromium.base.test.util.Restriction;
import org.chromium.base.test.util.RetryOnFailure;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
-import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.ChromeTabbedActivity;
import org.chromium.chrome.browser.IntentHandler;
@@ -90,7 +89,6 @@ import java.util.concurrent.atomic.AtomicReference;
* Instrumentation tests for app menu, context menu, and toolbar of a {@link CustomTabActivity}.
*/
public class CustomTabActivityTest extends CustomTabActivityTestBase {
- private static final String READ_IT_LATER_FEATURE = "ReadItLaterInMenu";
private static final int MAX_MENU_CUSTOM_ITEMS = 5;
private static final int NUM_CHROME_MENU_ITEMS = 2;
private static final String
@@ -322,8 +320,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
openAppMenuAndAssertMenuShown();
Menu menu = getActivity().getAppMenuHandler().getAppMenu().getMenu();
- final int expectedMenuSize = numMenuEntries + NUM_CHROME_MENU_ITEMS
- + (ChromeFeatureList.isEnabled(READ_IT_LATER_FEATURE) ? 1 : 0);
+ final int expectedMenuSize = numMenuEntries + NUM_CHROME_MENU_ITEMS;
final int actualMenuSize = getActualMenuSize(menu);
assertNotNull("App menu is not initialized: ", menu);
@@ -368,8 +365,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
openAppMenuAndAssertMenuShown();
Menu menu = getActivity().getAppMenuHandler().getAppMenu().getMenu();
- final int expectedMenuSize = MAX_MENU_CUSTOM_ITEMS + NUM_CHROME_MENU_ITEMS
- + (ChromeFeatureList.isEnabled(READ_IT_LATER_FEATURE) ? 1 : 0);
+ final int expectedMenuSize = MAX_MENU_CUSTOM_ITEMS + NUM_CHROME_MENU_ITEMS;
final int actualMenuSize = getActualMenuSize(menu);
assertNotNull("App menu is not initialized: ", menu);
assertEquals(expectedMenuSize, actualMenuSize);
@@ -415,31 +411,27 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
@RetryOnFailure
public void testOpenInBrowser() throws InterruptedException {
startCustomTabActivityWithIntent(createMinimalCustomTabIntent());
+ IntentFilter filter = new IntentFilter(Intent.ACTION_VIEW);
+ filter.addDataScheme(Uri.parse(mTestServer.getURL("/")).getScheme());
+ final ActivityMonitor monitor = getInstrumentation().addMonitor(filter, null, false);
openAppMenuAndAssertMenuShown();
- if (ChromeFeatureList.isEnabled(READ_IT_LATER_FEATURE)) {
- // TODO(ianwen): implement this test after read it later becomes a settled feature.
- } else {
- IntentFilter filter = new IntentFilter(Intent.ACTION_VIEW);
- filter.addDataScheme(Uri.parse(mTestServer.getURL("/")).getScheme());
- final ActivityMonitor monitor = getInstrumentation().addMonitor(filter, null, false);
- final String menuItemTitle = mActivity.getString(R.string.menu_open_in_product_default);
- ThreadUtils.runOnUiThread(new Runnable() {
- @Override
- public void run() {
- MenuItem item = mActivity.getAppMenuHandler()
- .getAppMenu().getMenu().findItem(R.id.open_in_browser_id);
- assertNotNull(item);
- assertEquals(menuItemTitle, item.getTitle().toString());
- mActivity.onMenuOrKeyboardAction(R.id.open_in_browser_id, false);
- }
- });
- CriteriaHelper.pollInstrumentationThread(new Criteria() {
- @Override
- public boolean isSatisfied() {
- return getInstrumentation().checkMonitorHit(monitor, 1);
- }
- });
- }
+ final String menuItemTitle = mActivity.getString(R.string.menu_open_in_product_default);
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ MenuItem item = mActivity.getAppMenuHandler()
+ .getAppMenu().getMenu().findItem(R.id.open_in_browser_id);
+ assertNotNull(item);
+ assertEquals(menuItemTitle, item.getTitle().toString());
+ mActivity.onMenuOrKeyboardAction(R.id.open_in_browser_id, false);
+ }
+ });
+ CriteriaHelper.pollInstrumentationThread(new Criteria() {
+ @Override
+ public boolean isSatisfied() {
+ return getInstrumentation().checkMonitorHit(monitor, 1);
+ }
+ });
}
/**
@@ -1401,7 +1393,7 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
ThreadUtils.postOnUiThread(new Runnable() {
@Override
public void run() {
- mActivity.openCurrentUrlInBrowser(true, true);
+ mActivity.openCurrentUrlInBrowser(true);
assertNull(mActivity.getActivityTab());
}
});

Powered by Google App Engine
This is Rietveld 408576698