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

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

Issue 1752233002: Convert Pass()→std::move() on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <utility>
11
10 #include "base/macros.h" 12 #include "base/macros.h"
11 #include "chrome/browser/status_icons/status_icon_menu_model.h" 13 #include "chrome/browser/status_icons/status_icon_menu_model.h"
12 #include "chrome/browser/status_icons/status_icon_observer.h" 14 #include "chrome/browser/status_icons/status_icon_observer.h"
13 #include "chrome/browser/ui/views/status_icons/status_icon_win.h" 15 #include "chrome/browser/ui/views/status_icons/status_icon_win.h"
14 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
15 #include "ui/gfx/image/image_skia.h" 17 #include "ui/gfx/image/image_skia.h"
16 #include "ui/gfx/image/image_unittest_util.h" 18 #include "ui/gfx/image/image_unittest_util.h"
17 19
18 namespace { 20 namespace {
19 21
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 StatusTrayWin tray; 71 StatusTrayWin tray;
70 } 72 }
71 73
72 TEST(StatusTrayWinTest, CreateIconAndMenu) { 74 TEST(StatusTrayWinTest, CreateIconAndMenu) {
73 // Create an icon, set the images, tooltip, and context menu, then shut it 75 // Create an icon, set the images, tooltip, and context menu, then shut it
74 // down. 76 // down.
75 StatusTrayWin tray; 77 StatusTrayWin tray;
76 StatusIcon* icon = CreateStatusIcon(&tray); 78 StatusIcon* icon = CreateStatusIcon(&tray);
77 scoped_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(NULL)); 79 scoped_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(NULL));
78 menu->AddItem(0, L"foo"); 80 menu->AddItem(0, L"foo");
79 icon->SetContextMenu(menu.Pass()); 81 icon->SetContextMenu(std::move(menu));
80 } 82 }
81 83
82 #if !defined(USE_AURA) // http://crbug.com/156370 84 #if !defined(USE_AURA) // http://crbug.com/156370
83 TEST(StatusTrayWinTest, ClickOnIcon) { 85 TEST(StatusTrayWinTest, ClickOnIcon) {
84 // Create an icon, send a fake click event, make sure observer is called. 86 // Create an icon, send a fake click event, make sure observer is called.
85 StatusTrayWin tray; 87 StatusTrayWin tray;
86 88
87 StatusIconWin* icon = CreateStatusIcon(&tray); 89 StatusIconWin* icon = CreateStatusIcon(&tray);
88 FakeStatusIconObserver observer; 90 FakeStatusIconObserver observer;
89 icon->AddObserver(&observer); 91 icon->AddObserver(&observer);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 131
130 StatusIconWin* icon = CreateStatusIcon(&tray); 132 StatusIconWin* icon = CreateStatusIcon(&tray);
131 133
132 icon->ForceVisible(); 134 icon->ForceVisible();
133 // |proxy| is owned by |tray|, and |tray| lives to the end of the scope, 135 // |proxy| is owned by |tray|, and |tray| lives to the end of the scope,
134 // so calling methods on |proxy| is safe. 136 // so calling methods on |proxy| is safe.
135 EXPECT_TRUE(proxy->enqueue_called()); 137 EXPECT_TRUE(proxy->enqueue_called());
136 EXPECT_EQ(proxy->window(), icon->window()); 138 EXPECT_EQ(proxy->window(), icon->window());
137 EXPECT_EQ(proxy->icon_id(), icon->icon_id()); 139 EXPECT_EQ(proxy->icon_id(), icon->icon_id());
138 } 140 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/status_icons/status_tray_win.cc ('k') | chrome/chrome_watcher/chrome_watcher_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698