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

Side by Side Diff: ui/base/cocoa/hover_image_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 (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 #import "ui/base/cocoa/hover_image_button.h" 5 #import "ui/base/cocoa/hover_image_button.h"
6 6
7 #import "base/memory/scoped_nsobject.h" 7 #import "base/mac/scoped_nsobject.h"
8 #import "ui/base/test/ui_cocoa_test_helper.h" 8 #import "ui/base/test/ui_cocoa_test_helper.h"
9 9
10 namespace { 10 namespace {
11 11
12 class HoverImageButtonTest : public ui::CocoaTest { 12 class HoverImageButtonTest : public ui::CocoaTest {
13 public: 13 public:
14 HoverImageButtonTest() { 14 HoverImageButtonTest() {
15 NSRect content_frame = [[test_window() contentView] frame]; 15 NSRect content_frame = [[test_window() contentView] frame];
16 scoped_nsobject<HoverImageButton> button( 16 base::scoped_nsobject<HoverImageButton> button(
17 [[HoverImageButton alloc] initWithFrame:content_frame]); 17 [[HoverImageButton alloc] initWithFrame:content_frame]);
18 button_ = button.get(); 18 button_ = button.get();
19 [[test_window() contentView] addSubview:button_]; 19 [[test_window() contentView] addSubview:button_];
20 } 20 }
21 21
22 void DrawRect() { 22 void DrawRect() {
23 [button_ lockFocus]; 23 [button_ lockFocus];
24 [button_ drawRect:[button_ bounds]]; 24 [button_ drawRect:[button_ bounds]];
25 [button_ unlockFocus]; 25 [button_ unlockFocus];
26 } 26 }
(...skipping 11 matching lines...) Expand all
38 [button_ mouseEntered:nil]; 38 [button_ mouseEntered:nil];
39 DrawRect(); 39 DrawRect();
40 EXPECT_EQ([button_ image], hover); 40 EXPECT_EQ([button_ image], hover);
41 [button_ mouseExited:nil]; 41 [button_ mouseExited:nil];
42 DrawRect(); 42 DrawRect();
43 EXPECT_NE([button_ image], hover); 43 EXPECT_NE([button_ image], hover);
44 EXPECT_EQ([button_ image], image); 44 EXPECT_EQ([button_ image], image);
45 } 45 }
46 46
47 } // namespace 47 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698