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

Unified Diff: chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc

Issue 2721953002: [Media Router] Add "Hide in menu/Show in toolbar" option to Cast toolbar icon (Closed)
Patch Set: Address Jennifer's and Mike's comments Created 3 years, 10 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 | « chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc
diff --git a/chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc b/chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc
index b867e61ab8e4ccbc5f81c4088c2f6cf52faa5dbb..a8133e709992dddac58c0d3ecbe8400023dda9fc 100644
--- a/chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc
+++ b/chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc
@@ -89,6 +89,11 @@ class MediaRouterUIBrowserTest : public InProcessBrowserTest {
->action();
}
+ ui::SimpleMenuModel* GetActionContextMenu() {
+ return static_cast<ui::SimpleMenuModel*>(
+ GetMediaRouterAction()->GetContextMenu());
+ }
+
void ExecuteMediaRouterAction(AppMenuButton* app_menu_button) {
EXPECT_TRUE(app_menu_button->IsMenuShowing());
GetMediaRouterAction()->ExecuteAction(true);
@@ -324,4 +329,26 @@ IN_PROC_BROWSER_TEST_F(MediaRouterUIBrowserTest,
EXPECT_TRUE(ActionExists());
}
+IN_PROC_BROWSER_TEST_F(MediaRouterUIBrowserTest, UpdateActionLocation) {
+ SetAlwaysShowActionPref(true);
+
+ // Get the index for "Hide in Chrome menu" / "Show in toolbar" menu item.
+ const int command_index = GetActionContextMenu()->GetIndexOfCommandId(
+ IDC_MEDIA_ROUTER_SHOW_IN_TOOLBAR);
+
+ // Start out with the action visible on the main bar.
+ EXPECT_TRUE(
+ toolbar_actions_bar_->IsActionVisibleOnMainBar(GetMediaRouterAction()));
+ GetActionContextMenu()->ActivatedAt(command_index);
+
+ // The action should get hidden in the overflow menu.
+ EXPECT_FALSE(
+ toolbar_actions_bar_->IsActionVisibleOnMainBar(GetMediaRouterAction()));
+ GetActionContextMenu()->ActivatedAt(command_index);
+
+ // The action should be back on the main bar.
+ EXPECT_TRUE(
+ toolbar_actions_bar_->IsActionVisibleOnMainBar(GetMediaRouterAction()));
+}
+
} // namespace media_router
« no previous file with comments | « chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698