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

Side by Side Diff: chrome/browser/ui/toolbar/media_router_action_unittest.cc

Issue 2143863004: Use vector assets for media router icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: init to zero Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/toolbar/media_router_action.cc ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "chrome/browser/ui/toolbar/toolbar_action_view_delegate.h" 11 #include "chrome/browser/ui/toolbar/toolbar_action_view_delegate.h"
12 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im pl.h" 12 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im pl.h"
13 #include "chrome/browser/ui/webui/media_router/media_router_test.h" 13 #include "chrome/browser/ui/webui/media_router/media_router_test.h"
14 #include "chrome/grit/generated_resources.h" 14 #include "chrome/grit/generated_resources.h"
15 #include "content/public/browser/site_instance.h" 15 #include "content/public/browser/site_instance.h"
16 #include "content/public/test/test_utils.h" 16 #include "content/public/test/test_utils.h"
17 #include "grit/theme_resources.h"
18 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
19 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
20 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/gfx/color_palette.h"
21 #include "ui/gfx/image/image_unittest_util.h" 20 #include "ui/gfx/image/image_unittest_util.h"
21 #include "ui/gfx/paint_vector_icon.h"
22 22
23 using content::WebContents; 23 using content::WebContents;
24 using media_router::MediaRouterDialogControllerImpl; 24 using media_router::MediaRouterDialogControllerImpl;
25 25
26 class MockToolbarActionViewDelegate : public ToolbarActionViewDelegate { 26 class MockToolbarActionViewDelegate : public ToolbarActionViewDelegate {
27 public: 27 public:
28 MockToolbarActionViewDelegate() {} 28 MockToolbarActionViewDelegate() {}
29 ~MockToolbarActionViewDelegate() {} 29 ~MockToolbarActionViewDelegate() {}
30 30
31 MOCK_CONST_METHOD0(GetCurrentWebContents, WebContents*()); 31 MOCK_CONST_METHOD0(GetCurrentWebContents, WebContents*());
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 "title fatal", 91 "title fatal",
92 "message fatal", 92 "message fatal",
93 media_router::IssueAction(media_router::IssueAction::TYPE_DISMISS), 93 media_router::IssueAction(media_router::IssueAction::TYPE_DISMISS),
94 std::vector<media_router::IssueAction>(), 94 std::vector<media_router::IssueAction>(),
95 "route_id", 95 "route_id",
96 media_router::Issue::FATAL, 96 media_router::Issue::FATAL,
97 true, 97 true,
98 -1)), 98 -1)),
99 fake_source1_("fakeSource1"), 99 fake_source1_("fakeSource1"),
100 fake_source2_("fakeSource2"), 100 fake_source2_("fakeSource2"),
101 active_icon_(ui::ResourceBundle::GetSharedInstance().GetImageNamed( 101 active_icon_(
102 IDR_MEDIA_ROUTER_ACTIVE_ICON)), 102 gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_ACTIVE,
103 error_icon_(ui::ResourceBundle::GetSharedInstance().GetImageNamed( 103 gfx::kPlaceholderColor)),
104 IDR_MEDIA_ROUTER_ERROR_ICON)), 104 error_icon_(gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_ERROR,
105 idle_icon_(ui::ResourceBundle::GetSharedInstance().GetImageNamed( 105 gfx::kPlaceholderColor)),
106 IDR_MEDIA_ROUTER_IDLE_ICON)), 106 idle_icon_(gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_IDLE,
107 warning_icon_(ui::ResourceBundle::GetSharedInstance().GetImageNamed( 107 gfx::kPlaceholderColor)),
108 IDR_MEDIA_ROUTER_WARNING_ICON)) {} 108 warning_icon_(
109 gfx::CreateVectorIcon(gfx::VectorIconId::MEDIA_ROUTER_WARNING,
110 gfx::kPlaceholderColor)) {}
109 111
110 ~MediaRouterActionUnitTest() override {} 112 ~MediaRouterActionUnitTest() override {}
111 113
112 // MediaRouterTest: 114 // MediaRouterTest:
113 void SetUp() override { 115 void SetUp() override {
114 MediaRouterTest::SetUp(); 116 MediaRouterTest::SetUp();
115 toolbar_model_ = extensions::extension_action_test_util:: 117 toolbar_model_ = extensions::extension_action_test_util::
116 CreateToolbarModelForProfileWithoutWaitingForReady(profile()); 118 CreateToolbarModelForProfileWithoutWaitingForReady(profile());
117 119
118 // browser() will only be valid once BrowserWithTestWindowTest::SetUp() 120 // browser() will only be valid once BrowserWithTestWindowTest::SetUp()
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // Pressing the icon while the popup is shown should close the popup 352 // Pressing the icon while the popup is shown should close the popup
351 EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1); 353 EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1);
352 action()->ExecuteAction(true); 354 action()->ExecuteAction(true);
353 355
354 EXPECT_CALL(*mock_delegate, OnPopupShown(true)).Times(1); 356 EXPECT_CALL(*mock_delegate, OnPopupShown(true)).Times(1);
355 dialog_controller_->CreateMediaRouterDialog(); 357 dialog_controller_->CreateMediaRouterDialog();
356 358
357 EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1); 359 EXPECT_CALL(*mock_delegate, OnPopupClosed()).Times(1);
358 dialog_controller_->HideMediaRouterDialog(); 360 dialog_controller_->HideMediaRouterDialog();
359 } 361 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/media_router_action.cc ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698