| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "chrome/browser/media/router/mock_media_router.h" | 8 #include "chrome/browser/media/router/mock_media_router.h" |
| 9 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" | 9 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" |
| 10 #include "chrome/browser/ui/toolbar/media_router_action_controller.h" | 10 #include "chrome/browser/ui/toolbar/media_router_action_controller.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 EXPECT_TRUE(HasComponentAction( | 32 EXPECT_TRUE(HasComponentAction( |
| 33 ComponentToolbarActionsFactory::kMediaRouterActionId)); | 33 ComponentToolbarActionsFactory::kMediaRouterActionId)); |
| 34 has_media_router_action_ = false; | 34 has_media_router_action_ = false; |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool HasComponentAction(const std::string& action_id) const override { | 37 bool HasComponentAction(const std::string& action_id) const override { |
| 38 EXPECT_EQ(action_id, ComponentToolbarActionsFactory::kMediaRouterActionId); | 38 EXPECT_EQ(action_id, ComponentToolbarActionsFactory::kMediaRouterActionId); |
| 39 return has_media_router_action_; | 39 return has_media_router_action_; |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool ActionsInitialized() const override { return true; } |
| 43 |
| 42 private: | 44 private: |
| 43 bool has_media_router_action_ = false; | 45 bool has_media_router_action_ = false; |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 class MediaRouterActionControllerUnitTest : public MediaRouterTest { | 48 class MediaRouterActionControllerUnitTest : public MediaRouterTest { |
| 47 public: | 49 public: |
| 48 MediaRouterActionControllerUnitTest() | 50 MediaRouterActionControllerUnitTest() |
| 49 : issue_(media_router::Issue( | 51 : issue_(media_router::Issue( |
| 50 "title notification", | 52 "title notification", |
| 51 "message notification", | 53 "message notification", |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 188 |
| 187 SetAlwaysShowActionPref(true); | 189 SetAlwaysShowActionPref(true); |
| 188 controller()->OnRoutesUpdated(non_local_display_route_list(), | 190 controller()->OnRoutesUpdated(non_local_display_route_list(), |
| 189 empty_route_id_list()); | 191 empty_route_id_list()); |
| 190 // Removing the local route should not hide the icon. | 192 // Removing the local route should not hide the icon. |
| 191 EXPECT_TRUE(ActionExists()); | 193 EXPECT_TRUE(ActionExists()); |
| 192 | 194 |
| 193 SetAlwaysShowActionPref(false); | 195 SetAlwaysShowActionPref(false); |
| 194 EXPECT_FALSE(ActionExists()); | 196 EXPECT_FALSE(ActionExists()); |
| 195 } | 197 } |
| OLD | NEW |