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

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

Issue 2620763004: [Android] Fix bugs for menu item display in CCT (Closed)
Patch Set: Created 3 years, 11 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 13020919b4b483ec636943a9c4a4233ea7368d27..ee78094b6bd4e965caffe05077c0cefe67fd60a3 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
@@ -388,6 +388,30 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
}
/**
+ * Test the entries in app menu for media viewer.
+ */
+ @SmallTest
+ @RetryOnFailure
+ public void testAppMenuForMediaViewer() throws InterruptedException {
+ Intent intent = createMinimalCustomTabIntent();
+ intent.putExtra(CustomTabIntentDataProvider.EXTRA_IS_MEDIA_VIEWER, true);
+ IntentHandler.addTrustedIntentExtras(intent);
+ startCustomTabActivityWithIntent(intent);
+
+ openAppMenuAndAssertMenuShown();
+ Menu menu = getActivity().getAppMenuHandler().getAppMenu().getMenu();
+ final int expectedMenuSize = 0;
+ final int actualMenuSize = getActualMenuSize(menu);
+
+ assertNotNull("App menu is not initialized: ", menu);
+ assertEquals(expectedMenuSize, actualMenuSize);
+ assertFalse(menu.findItem(R.id.find_in_page_id).isVisible());
+ assertFalse(menu.findItem(R.id.add_to_homescreen_id).isVisible());
+ assertFalse(menu.findItem(R.id.request_desktop_site_id).isVisible());
+ assertFalse(menu.findItem(R.id.open_in_browser_id).isVisible());
+ }
+
+ /**
* Tests if the default share item can be shown in the app menu.
*/
@SmallTest

Powered by Google App Engine
This is Rietveld 408576698