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

Side by Side Diff: ui/base/cocoa/controls/hover_image_menu_button_unittest.mm

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #import "ui/base/cocoa/controls/hover_image_menu_button.h" 5 #import "ui/base/cocoa/controls/hover_image_menu_button.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #import "testing/gtest_mac.h" 8 #import "testing/gtest_mac.h"
9 #import "ui/base/cocoa/controls/hover_image_menu_button_cell.h" 9 #import "ui/base/cocoa/controls/hover_image_menu_button_cell.h"
10 #import "ui/base/test/ui_cocoa_test_helper.h" 10 #import "ui/base/test/ui_cocoa_test_helper.h"
11 11
12 namespace ui { 12 namespace ui {
13 13
14 namespace { 14 namespace {
15 15
16 // Test initialization and display of the NSPopUpButton that shows the drop- 16 // Test initialization and display of the NSPopUpButton that shows the drop-
17 // down menu. Don't try to show the menu, since it will block the thread. 17 // down menu. Don't try to show the menu, since it will block the thread.
18 class HoverImageMenuButtonTest : public CocoaTest { 18 class HoverImageMenuButtonTest : public CocoaTest {
19 public: 19 public:
20 HoverImageMenuButtonTest() {} 20 HoverImageMenuButtonTest() {}
21 21
22 // CocoaTest override: 22 // CocoaTest override:
23 virtual void SetUp() OVERRIDE; 23 virtual void SetUp() OVERRIDE;
24 24
25 protected: 25 protected:
26 scoped_nsobject<HoverImageMenuButton> menu_button_; 26 base::scoped_nsobject<HoverImageMenuButton> menu_button_;
27 scoped_nsobject<NSImage> normal_; 27 base::scoped_nsobject<NSImage> normal_;
28 scoped_nsobject<NSImage> pressed_; 28 base::scoped_nsobject<NSImage> pressed_;
29 scoped_nsobject<NSImage> hovered_; 29 base::scoped_nsobject<NSImage> hovered_;
30 30
31 DISALLOW_COPY_AND_ASSIGN(HoverImageMenuButtonTest); 31 DISALLOW_COPY_AND_ASSIGN(HoverImageMenuButtonTest);
32 }; 32 };
33 33
34 void HoverImageMenuButtonTest::SetUp() { 34 void HoverImageMenuButtonTest::SetUp() {
35 menu_button_.reset( 35 menu_button_.reset(
36 [[HoverImageMenuButton alloc] initWithFrame:NSMakeRect(0, 0, 50, 30) 36 [[HoverImageMenuButton alloc] initWithFrame:NSMakeRect(0, 0, 50, 30)
37 pullsDown:YES]); 37 pullsDown:YES]);
38 38
39 normal_.reset([base::mac::ObjCCastStrict<NSImage>( 39 normal_.reset([base::mac::ObjCCastStrict<NSImage>(
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 EXPECT_FALSE([menu_button_ needsDisplay]); 164 EXPECT_FALSE([menu_button_ needsDisplay]);
165 165
166 [menu_button_ mouseExited:nil]; 166 [menu_button_ mouseExited:nil];
167 EXPECT_TRUE([menu_button_ needsDisplay]); 167 EXPECT_TRUE([menu_button_ needsDisplay]);
168 EXPECT_NSEQ(normal_, [[menu_button_ cell] imageToDraw]); 168 EXPECT_NSEQ(normal_, [[menu_button_ cell] imageToDraw]);
169 [menu_button_ display]; 169 [menu_button_ display];
170 EXPECT_FALSE([menu_button_ needsDisplay]); 170 EXPECT_FALSE([menu_button_ needsDisplay]);
171 } 171 }
172 172
173 } // namespace ui 173 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698