Chromium Code Reviews| Index: chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc |
| diff --git a/chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc b/chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc |
| index 062151ba44d87125a5e9cf95052c671665edf1a7..fa851342131c27a98d1becab37b78162fe36fcb8 100644 |
| --- a/chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc |
| +++ b/chrome/browser/ui/toolbar/media_router_contextual_menu_unittest.cc |
| @@ -89,3 +89,29 @@ TEST_F(MediaRouterContextualMenuUnitTest, Basic) { |
| EXPECT_TRUE(model()->IsVisibleAt(i)); |
| } |
| } |
| + |
| +#if defined(GOOGLE_CHROME_BUILD) |
| +// Tests whether the cloud services item is correctly toggled. This menu item |
| +// is only availble on official Chrome builds. |
| +TEST_F(MediaRouterContextualMenuUnitTest, ToggleCloudServicesItem) { |
| + // The Media Router Action has a getter for the model, but not the delegate. |
| + // Create the delegate for this test. |
|
msw
2016/07/29 02:31:50
nit: Create the MediaRouterContextualMenu ui::Simp
apacible
2016/07/29 15:19:41
Done.
|
| + MediaRouterContextualMenu menu(browser()); |
| + |
| + // Set up an authenticated account such that the cloud services menu item is |
| + // surfaced. Whether or not it is surfaced is tested in the "Basic" test. |
| + signin_manager()->SetAuthenticatedAccountInfo("foo@bar.com", "password"); |
| + |
| + // By default, the command is not checked. |
| + EXPECT_FALSE(menu.IsCommandIdChecked( |
| + IDC_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE)); |
| + |
| + menu.ExecuteCommand(IDC_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE, 0); |
| + EXPECT_TRUE(menu.IsCommandIdChecked( |
| + IDC_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE)); |
| + |
| + menu.ExecuteCommand(IDC_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE, 0); |
| + EXPECT_FALSE(menu.IsCommandIdChecked( |
| + IDC_MEDIA_ROUTER_CLOUD_SERVICES_TOGGLE)); |
| +} |
| +#endif // GOOGLE_CHROME_BUILD |