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

Side by Side Diff: chrome/browser/cocoa/browser_window_controller_unittest.mm

Issue 126294: Mac fullscreen mode (with pkasting). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/scoped_nsautorelease_pool.h" 6 #include "base/scoped_nsautorelease_pool.h"
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/cocoa/browser_test_helper.h" 9 #include "chrome/browser/cocoa/browser_test_helper.h"
10 #include "chrome/browser/cocoa/browser_window_controller.h" 10 #include "chrome/browser/cocoa/browser_window_controller.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 ASSERT_TRUE(prefs->GetDictionary(prefs::kBrowserWindowPlacement) == NULL); 43 ASSERT_TRUE(prefs->GetDictionary(prefs::kBrowserWindowPlacement) == NULL);
44 44
45 // Ask the window to save its position, then check that a preference 45 // Ask the window to save its position, then check that a preference
46 // exists. We're technically passing in a pointer to the user prefs 46 // exists. We're technically passing in a pointer to the user prefs
47 // and not the local state prefs, but a PrefService* is a 47 // and not the local state prefs, but a PrefService* is a
48 // PrefService*, and this is a unittest. 48 // PrefService*, and this is a unittest.
49 [controller_ saveWindowPositionToPrefs:prefs]; 49 [controller_ saveWindowPositionToPrefs:prefs];
50 EXPECT_TRUE(prefs->GetDictionary(prefs::kBrowserWindowPlacement) != NULL); 50 EXPECT_TRUE(prefs->GetDictionary(prefs::kBrowserWindowPlacement) != NULL);
51 } 51 }
52 52
53 @interface BrowserWindowControllerFakeFullscreen : BrowserWindowController {
54 }
55 @end
56 @implementation BrowserWindowControllerFakeFullscreen
57 // This isn't needed to pass the test, but does prevent an actual
58 // fullscreen from happening.
59 - (NSWindow*)fullscreenWindow {
60 return nil;
61 }
62 @end
63
64 TEST_F(BrowserWindowControllerTest, TestFullscreen) {
65 // Note use of "controller", not "controller_"
66 scoped_nsobject<BrowserWindowController> controller;
67 controller.reset([[BrowserWindowControllerFakeFullscreen alloc]
68 initWithBrowser:browser_helper_.browser()
69 takeOwnership:NO]);
70 EXPECT_FALSE([controller isFullscreen]);
71 [controller setFullscreen:YES];
72 EXPECT_TRUE([controller isFullscreen]);
73 [controller setFullscreen:NO];
74 EXPECT_FALSE([controller isFullscreen]);
75
76 // Confirm the real fullscreen command doesn't return nil
77 EXPECT_TRUE([controller_ fullscreenWindow]);
78 }
79
53 /* TODO(???): test other methods of BrowserWindowController */ 80 /* TODO(???): test other methods of BrowserWindowController */
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.mm ('k') | chrome/browser/cocoa/fullscreen_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698