| Index: chrome/browser/views/status_icons/status_tray_win_unittest.cc
|
| diff --git a/chrome/browser/views/status_icons/status_tray_win_unittest.cc b/chrome/browser/views/status_icons/status_tray_win_unittest.cc
|
| index e5499b9e0e7ac8d47f8cc0467b71e041d0a544c1..c824755d71a7082e973ea8e0877531687ed4f7d2 100644
|
| --- a/chrome/browser/views/status_icons/status_tray_win_unittest.cc
|
| +++ b/chrome/browser/views/status_icons/status_tray_win_unittest.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "app/menus/simple_menu_model.h"
|
| #include "app/resource_bundle.h"
|
| #include "base/string_util.h"
|
| #include "base/utf_string_conversions.h"
|
| @@ -24,8 +25,9 @@ TEST(StatusTrayWinTest, CreateTray) {
|
| StatusTrayWin tray;
|
| }
|
|
|
| -TEST(StatusTrayWinTest, CreateIcon) {
|
| - // Create an icon, set the images and tooltip, then shut it down.
|
| +TEST(StatusTrayWinTest, CreateIconAndMenu) {
|
| + // Create an icon, set the images, tooltip, and context menu, then shut it
|
| + // down.
|
| StatusTrayWin tray;
|
| StatusIcon* icon = tray.CreateStatusIcon();
|
| SkBitmap* bitmap = ResourceBundle::GetSharedInstance().GetBitmapNamed(
|
| @@ -33,6 +35,9 @@ TEST(StatusTrayWinTest, CreateIcon) {
|
| icon->SetImage(*bitmap);
|
| icon->SetPressedImage(*bitmap);
|
| icon->SetToolTip(ASCIIToUTF16("tool tip"));
|
| + menus::SimpleMenuModel* menu = new menus::SimpleMenuModel(NULL);
|
| + menu->AddItem(0, L"foo");
|
| + icon->SetContextMenu(menu);
|
| }
|
|
|
| TEST(StatusTrayWinTest, ClickOnIcon) {
|
| @@ -44,5 +49,7 @@ TEST(StatusTrayWinTest, ClickOnIcon) {
|
| EXPECT_CALL(observer, OnClicked());
|
| // Mimic a click.
|
| tray.WndProc(NULL, icon->message_id(), icon->icon_id(), WM_LBUTTONDOWN);
|
| + // Mimic a right-click - observer should not be called.
|
| + tray.WndProc(NULL, icon->message_id(), icon->icon_id(), WM_RBUTTONDOWN);
|
| icon->RemoveObserver(&observer);
|
| }
|
|
|