| Index: chrome/browser/ui/toolbar/media_router_action_controller_unittest.cc
|
| diff --git a/chrome/browser/ui/toolbar/media_router_action_controller_unittest.cc b/chrome/browser/ui/toolbar/media_router_action_controller_unittest.cc
|
| index 6f25b895dd61e4b76709547829ab0b8f3b7a583f..26fdf0ffb9489c64a451c1f8b9c36ecf36cea8ac 100644
|
| --- a/chrome/browser/ui/toolbar/media_router_action_controller_unittest.cc
|
| +++ b/chrome/browser/ui/toolbar/media_router_action_controller_unittest.cc
|
| @@ -137,7 +137,7 @@ class MediaRouterActionControllerUnitTest : public MediaRouterTest {
|
| DISALLOW_COPY_AND_ASSIGN(MediaRouterActionControllerUnitTest);
|
| };
|
|
|
| -TEST_F(MediaRouterActionControllerUnitTest, EphemeralIcon) {
|
| +TEST_F(MediaRouterActionControllerUnitTest, EphemeralIconForRoutesAndIssues) {
|
| EXPECT_FALSE(ActionExists());
|
|
|
| // Creating a local route should show the action icon.
|
| @@ -172,6 +172,34 @@ TEST_F(MediaRouterActionControllerUnitTest, EphemeralIcon) {
|
| EXPECT_FALSE(ActionExists());
|
| }
|
|
|
| +TEST_F(MediaRouterActionControllerUnitTest, EphemeralIconForDialog) {
|
| + EXPECT_FALSE(ActionExists());
|
| +
|
| + // Showing a dialog should show the icon.
|
| + controller()->OnDialogShown();
|
| + EXPECT_TRUE(ActionExists());
|
| + // Showing and hiding a dialog shouldn't hide the icon as long as we have a
|
| + // positive number of dialogs.
|
| + controller()->OnDialogShown();
|
| + EXPECT_TRUE(ActionExists());
|
| + controller()->OnDialogHidden();
|
| + EXPECT_TRUE(ActionExists());
|
| + // When we have zero dialogs, the icon should be hidden.
|
| + controller()->OnDialogHidden();
|
| + EXPECT_FALSE(ActionExists());
|
| +
|
| + controller()->OnDialogShown();
|
| + EXPECT_TRUE(ActionExists());
|
| + controller()->OnRoutesUpdated(local_display_route_list(),
|
| + empty_route_id_list());
|
| + // Hiding the dialog while there are local routes shouldn't hide the icon.
|
| + controller()->OnDialogHidden();
|
| + EXPECT_TRUE(ActionExists());
|
| + controller()->OnRoutesUpdated(non_local_display_route_list(),
|
| + empty_route_id_list());
|
| + EXPECT_FALSE(ActionExists());
|
| +}
|
| +
|
| TEST_F(MediaRouterActionControllerUnitTest, ObserveAlwaysShowPrefChange) {
|
| EXPECT_FALSE(ActionExists());
|
|
|
|
|