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

Side by Side Diff: chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc

Issue 464163003: Remove IDR_STATUS_TRAY_ICON_PRESSED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated the comment Created 6 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/status_icons/status_tray_win.h" 5 #include "chrome/browser/ui/views/status_icons/status_tray_win.h"
6 6
7 #include <commctrl.h> 7 #include <commctrl.h>
8 8
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 TEST(StatusTrayWinTest, CreateIconAndMenu) { 66 TEST(StatusTrayWinTest, CreateIconAndMenu) {
67 // Create an icon, set the images, tooltip, and context menu, then shut it 67 // Create an icon, set the images, tooltip, and context menu, then shut it
68 // down. 68 // down.
69 StatusTrayWin tray; 69 StatusTrayWin tray;
70 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 70 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
71 gfx::ImageSkia* image = rb.GetImageSkiaNamed(IDR_STATUS_TRAY_ICON); 71 gfx::ImageSkia* image = rb.GetImageSkiaNamed(IDR_STATUS_TRAY_ICON);
72 StatusIcon* icon = tray.CreateStatusIcon( 72 StatusIcon* icon = tray.CreateStatusIcon(
73 StatusTray::OTHER_ICON, *image, base::ASCIIToUTF16("tool tip")); 73 StatusTray::OTHER_ICON, *image, base::ASCIIToUTF16("tool tip"));
74 icon->SetPressedImage(*image);
75 scoped_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(NULL)); 74 scoped_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(NULL));
76 menu->AddItem(0, L"foo"); 75 menu->AddItem(0, L"foo");
77 icon->SetContextMenu(menu.Pass()); 76 icon->SetContextMenu(menu.Pass());
78 } 77 }
79 78
80 #if !defined(USE_AURA) // http://crbug.com/156370 79 #if !defined(USE_AURA) // http://crbug.com/156370
81 TEST(StatusTrayWinTest, ClickOnIcon) { 80 TEST(StatusTrayWinTest, ClickOnIcon) {
82 // Create an icon, send a fake click event, make sure observer is called. 81 // Create an icon, send a fake click event, make sure observer is called.
83 StatusTrayWin tray; 82 StatusTrayWin tray;
84 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 83 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 StatusIconWin* icon = static_cast<StatusIconWin*>(tray.CreateStatusIcon( 140 StatusIconWin* icon = static_cast<StatusIconWin*>(tray.CreateStatusIcon(
142 StatusTray::OTHER_ICON, *image, base::ASCIIToUTF16("tool tip"))); 141 StatusTray::OTHER_ICON, *image, base::ASCIIToUTF16("tool tip")));
143 142
144 icon->ForceVisible(); 143 icon->ForceVisible();
145 // |proxy| is owned by |tray|, and |tray| lives to the end of the scope, 144 // |proxy| is owned by |tray|, and |tray| lives to the end of the scope,
146 // so calling methods on |proxy| is safe. 145 // so calling methods on |proxy| is safe.
147 EXPECT_TRUE(proxy->enqueue_called()); 146 EXPECT_TRUE(proxy->enqueue_called());
148 EXPECT_EQ(proxy->window(), icon->window()); 147 EXPECT_EQ(proxy->window(), icon->window());
149 EXPECT_EQ(proxy->icon_id(), icon->icon_id()); 148 EXPECT_EQ(proxy->icon_id(), icon->icon_id());
150 } 149 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_icons/status_icon_win.cc ('k') | ui/views/linux_ui/status_icon_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698