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

Side by Side Diff: chrome/browser/ui/cocoa/tracking_area_unittest.mm

Issue 6480067: [Mac] Placate Clang's (pedantic) warning about CrTrackingArea's initializer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/scoped_nsobject.h" 5 #include "base/scoped_nsobject.h"
6 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" 6 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h"
7 #include "chrome/browser/ui/cocoa/objc_zombie.h" 7 #include "chrome/browser/ui/cocoa/objc_zombie.h"
8 #import "chrome/browser/ui/cocoa/tracking_area.h" 8 #import "chrome/browser/ui/cocoa/tracking_area.h"
9 9
10 // A test object that counts the number of times a message is sent to it. 10 // A test object that counts the number of times a message is sent to it.
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 @end 24 @end
25 25
26 class CrTrackingAreaTest : public CocoaTest { 26 class CrTrackingAreaTest : public CocoaTest {
27 public: 27 public:
28 CrTrackingAreaTest() 28 CrTrackingAreaTest()
29 : owner_([[TestTrackingAreaOwner alloc] init]), 29 : owner_([[TestTrackingAreaOwner alloc] init]),
30 trackingArea_([[CrTrackingArea alloc] 30 trackingArea_([[CrTrackingArea alloc]
31 initWithRect:NSMakeRect(0, 0, 100, 100) 31 initWithRect:NSMakeRect(0, 0, 100, 100)
32 options:NSTrackingMouseMoved | NSTrackingActiveInKeyWindow 32 options:NSTrackingMouseMoved | NSTrackingActiveInKeyWindow
33 owner:owner_.get() 33 proxiedOwner:owner_.get()
34 userInfo:nil]) { 34 userInfo:nil]) {
35 } 35 }
36 36
37 scoped_nsobject<TestTrackingAreaOwner> owner_; 37 scoped_nsobject<TestTrackingAreaOwner> owner_;
38 scoped_nsobject<CrTrackingArea> trackingArea_; 38 scoped_nsobject<CrTrackingArea> trackingArea_;
39 }; 39 };
40 40
41 TEST_F(CrTrackingAreaTest, OwnerForwards) { 41 TEST_F(CrTrackingAreaTest, OwnerForwards) {
42 [[trackingArea_ owner] performMessage]; 42 [[trackingArea_ owner] performMessage];
43 EXPECT_EQ(1U, [owner_ messageCount]); 43 EXPECT_EQ(1U, [owner_ messageCount]);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 [owner_ shouldBecomeCrZombie]; 78 [owner_ shouldBecomeCrZombie];
79 owner_.reset(); 79 owner_.reset();
80 [trackingArea_ clearOwner]; 80 [trackingArea_ clearOwner];
81 81
82 [[trackingArea_ owner] performMessage]; 82 [[trackingArea_ owner] performMessage];
83 // Don't crash! 83 // Don't crash!
84 84
85 ObjcEvilDoers::ZombieDisable(); 85 ObjcEvilDoers::ZombieDisable();
86 } 86 }
OLDNEW
« chrome/browser/ui/cocoa/tracking_area.mm ('K') | « chrome/browser/ui/cocoa/tracking_area.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698