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

Side by Side Diff: chrome/browser/ui/cocoa/fullscreen_window_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) 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/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.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/fullscreen_window.h" 7 #include "chrome/browser/ui/cocoa/fullscreen_window.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "testing/platform_test.h" 9 #include "testing/platform_test.h"
10 10
11 @interface PerformCloseUIItem : NSObject<NSValidatedUserInterfaceItem> 11 @interface PerformCloseUIItem : NSObject<NSValidatedUserInterfaceItem>
12 @end 12 @end
13 13
14 @implementation PerformCloseUIItem 14 @implementation PerformCloseUIItem
15 - (SEL)action { 15 - (SEL)action {
16 return @selector(performClose:); 16 return @selector(performClose:);
17 } 17 }
18 18
19 - (NSInteger)tag { 19 - (NSInteger)tag {
20 return 0; 20 return 0;
21 } 21 }
22 @end 22 @end
23 23
24 class FullscreenWindowTest : public CocoaTest { 24 class FullscreenWindowTest : public CocoaTest {
25 }; 25 };
26 26
27 TEST_F(FullscreenWindowTest, Basics) { 27 TEST_F(FullscreenWindowTest, Basics) {
28 scoped_nsobject<FullscreenWindow> window; 28 base::scoped_nsobject<FullscreenWindow> window;
29 window.reset([[FullscreenWindow alloc] init]); 29 window.reset([[FullscreenWindow alloc] init]);
30 30
31 EXPECT_EQ([NSScreen mainScreen], [window screen]); 31 EXPECT_EQ([NSScreen mainScreen], [window screen]);
32 EXPECT_TRUE([window canBecomeKeyWindow]); 32 EXPECT_TRUE([window canBecomeKeyWindow]);
33 EXPECT_TRUE([window canBecomeMainWindow]); 33 EXPECT_TRUE([window canBecomeMainWindow]);
34 EXPECT_EQ(NSBorderlessWindowMask, [window styleMask]); 34 EXPECT_EQ(NSBorderlessWindowMask, [window styleMask]);
35 EXPECT_TRUE(NSEqualRects([[NSScreen mainScreen] frame], [window frame])); 35 EXPECT_TRUE(NSEqualRects([[NSScreen mainScreen] frame], [window frame]));
36 EXPECT_FALSE([window isReleasedWhenClosed]); 36 EXPECT_FALSE([window isReleasedWhenClosed]);
37 } 37 }
38 38
39 TEST_F(FullscreenWindowTest, CanPerformClose) { 39 TEST_F(FullscreenWindowTest, CanPerformClose) {
40 scoped_nsobject<FullscreenWindow> window; 40 base::scoped_nsobject<FullscreenWindow> window;
41 window.reset([[FullscreenWindow alloc] init]); 41 window.reset([[FullscreenWindow alloc] init]);
42 42
43 scoped_nsobject<PerformCloseUIItem> item; 43 base::scoped_nsobject<PerformCloseUIItem> item;
44 item.reset([[PerformCloseUIItem alloc] init]); 44 item.reset([[PerformCloseUIItem alloc] init]);
45 45
46 EXPECT_TRUE([window validateUserInterfaceItem:item.get()]); 46 EXPECT_TRUE([window validateUserInterfaceItem:item.get()]);
47 } 47 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698