| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "chrome/browser/extensions/browser_action_test_util.h" | 6 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 7 #include "chrome/browser/extensions/extension_action_test_util.h" | 7 #include "chrome/browser/extensions/extension_action_test_util.h" |
| 8 #include "chrome/browser/ui/browser_commands.h" | 8 #include "chrome/browser/ui/browser_commands.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/browser/ui/toolbar/media_router_action.h" | 10 #include "chrome/browser/ui/toolbar/media_router_action.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 MediaRouterDialogControllerImpl* controller_; | 63 MediaRouterDialogControllerImpl* controller_; |
| 64 MediaRouterActionPlatformDelegate* platform_delegate_; | 64 MediaRouterActionPlatformDelegate* platform_delegate_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 class MediaRouterActionUnitTest : public MediaRouterTest { | 67 class MediaRouterActionUnitTest : public MediaRouterTest { |
| 68 public: | 68 public: |
| 69 MediaRouterActionUnitTest() | 69 MediaRouterActionUnitTest() |
| 70 : toolbar_model_(nullptr), | 70 : toolbar_model_(nullptr), |
| 71 fake_issue_notification_(media_router::Issue( | 71 fake_issue_notification_("title notification", |
| 72 "title notification", | 72 media_router::Issue::ActionType::DISMISS, |
| 73 "message notification", | 73 media_router::Issue::Severity::NOTIFICATION), |
| 74 media_router::IssueAction(media_router::IssueAction::TYPE_DISMISS), | 74 fake_issue_warning_("title warning", |
| 75 std::vector<media_router::IssueAction>(), | 75 media_router::Issue::ActionType::LEARN_MORE, |
| 76 "route_id", | 76 media_router::Issue::Severity::WARNING), |
| 77 media_router::Issue::NOTIFICATION, | 77 fake_issue_fatal_("title fatal", |
| 78 false, | 78 media_router::Issue::ActionType::DISMISS, |
| 79 -1)), | 79 media_router::Issue::Severity::FATAL), |
| 80 fake_issue_warning_( | |
| 81 media_router::Issue("title warning", | |
| 82 "message warning", | |
| 83 media_router::IssueAction( | |
| 84 media_router::IssueAction::TYPE_LEARN_MORE), | |
| 85 std::vector<media_router::IssueAction>(), | |
| 86 "route_id", | |
| 87 media_router::Issue::WARNING, | |
| 88 false, | |
| 89 12345)), | |
| 90 fake_issue_fatal_(media_router::Issue( | |
| 91 "title fatal", | |
| 92 "message fatal", | |
| 93 media_router::IssueAction(media_router::IssueAction::TYPE_DISMISS), | |
| 94 std::vector<media_router::IssueAction>(), | |
| 95 "route_id", | |
| 96 media_router::Issue::FATAL, | |
| 97 true, | |
| 98 -1)), | |
| 99 fake_source1_("fakeSource1"), | 80 fake_source1_("fakeSource1"), |
| 100 fake_source2_("fakeSource2"), | 81 fake_source2_("fakeSource2"), |
| 101 active_icon_( | 82 active_icon_( |
| 102 gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_ACTIVE, | 83 gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_ACTIVE, |
| 103 gfx::kPlaceholderColor)), | 84 gfx::kPlaceholderColor)), |
| 104 error_icon_(gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_ERROR, | 85 error_icon_(gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_ERROR, |
| 105 gfx::kPlaceholderColor)), | 86 gfx::kPlaceholderColor)), |
| 106 idle_icon_(gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_IDLE, | 87 idle_icon_(gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_IDLE, |
| 107 gfx::kPlaceholderColor)), | 88 gfx::kPlaceholderColor)), |
| 108 warning_icon_( | 89 warning_icon_( |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // Pressing the icon while the popup is shown should close the popup | 333 // Pressing the icon while the popup is shown should close the popup |
| 353 EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1); | 334 EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1); |
| 354 action()->ExecuteAction(true); | 335 action()->ExecuteAction(true); |
| 355 | 336 |
| 356 EXPECT_CALL(*mock_delegate, OnPopupShown(true)).Times(1); | 337 EXPECT_CALL(*mock_delegate, OnPopupShown(true)).Times(1); |
| 357 dialog_controller_->CreateMediaRouterDialog(); | 338 dialog_controller_->CreateMediaRouterDialog(); |
| 358 | 339 |
| 359 EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1); | 340 EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1); |
| 360 dialog_controller_->HideMediaRouterDialog(); | 341 dialog_controller_->HideMediaRouterDialog(); |
| 361 } | 342 } |
| OLD | NEW |