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

Side by Side Diff: ui/message_center/cocoa/status_item_view_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, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/message_center/cocoa/status_item_view.h" 5 #import "ui/message_center/cocoa/status_item_view.h"
6 6
7 #include "base/memory/scoped_nsobject.h" 7 #include "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 class StatusItemViewTest : public ui::CocoaTest { 10 class StatusItemViewTest : public ui::CocoaTest {
11 public: 11 public:
12 StatusItemViewTest() 12 StatusItemViewTest()
13 : view_([[MCStatusItemView alloc] init]) { 13 : view_([[MCStatusItemView alloc] init]) {
14 } 14 }
15 15
16 virtual void SetUp() OVERRIDE { 16 virtual void SetUp() OVERRIDE {
17 ui::CocoaTest::SetUp(); 17 ui::CocoaTest::SetUp();
18 [[test_window() contentView] addSubview:view_]; 18 [[test_window() contentView] addSubview:view_];
19 } 19 }
20 20
21 virtual void TearDown() OVERRIDE { 21 virtual void TearDown() OVERRIDE {
22 [view_ removeItem]; 22 [view_ removeItem];
23 ui::CocoaTest::TearDown(); 23 ui::CocoaTest::TearDown();
24 } 24 }
25 25
26 protected: 26 protected:
27 scoped_nsobject<MCStatusItemView> view_; 27 base::scoped_nsobject<MCStatusItemView> view_;
28 }; 28 };
29 29
30 // These tests are like TEST_VIEW() but set some of the properties. 30 // These tests are like TEST_VIEW() but set some of the properties.
31 31
32 TEST_F(StatusItemViewTest, Callback) { 32 TEST_F(StatusItemViewTest, Callback) {
33 __block BOOL got_callback = NO; 33 __block BOOL got_callback = NO;
34 [view_ setCallback:^{ 34 [view_ setCallback:^{
35 got_callback = YES; 35 got_callback = YES;
36 }]; 36 }];
37 [view_ mouseDown:nil]; 37 [view_ mouseDown:nil];
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 TEST_F(StatusItemViewTest, HighlightAndMouseEvent) { 88 TEST_F(StatusItemViewTest, HighlightAndMouseEvent) {
89 [view_ mouseDown:nil]; 89 [view_ mouseDown:nil];
90 [view_ display]; 90 [view_ display];
91 [view_ setHighlight:YES]; 91 [view_ setHighlight:YES];
92 [view_ display]; 92 [view_ display];
93 [view_ mouseUp:nil]; 93 [view_ mouseUp:nil];
94 [view_ display]; 94 [view_ display];
95 [view_ setHighlight:NO]; 95 [view_ setHighlight:NO];
96 [view_ display]; 96 [view_ display];
97 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698