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

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

Issue 5915006: Remove user-related data from local_state and add to user_preferences, i... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: svn pset Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/l10n_util_mac.h" 5 #include "app/l10n_util_mac.h"
6 #include "base/scoped_nsobject.h" 6 #include "base/scoped_nsobject.h"
7 #include "base/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/browser_window.h" 9 #include "chrome/browser/browser_window.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 }; 81 };
82 82
83 TEST_F(BrowserWindowControllerTest, TestSaveWindowPosition) { 83 TEST_F(BrowserWindowControllerTest, TestSaveWindowPosition) {
84 PrefService* prefs = browser_helper_.profile()->GetPrefs(); 84 PrefService* prefs = browser_helper_.profile()->GetPrefs();
85 ASSERT_TRUE(prefs != NULL); 85 ASSERT_TRUE(prefs != NULL);
86 86
87 // Check to make sure there is no existing pref for window placement. 87 // Check to make sure there is no existing pref for window placement.
88 ASSERT_TRUE(prefs->GetDictionary(prefs::kBrowserWindowPlacement) == NULL); 88 ASSERT_TRUE(prefs->GetDictionary(prefs::kBrowserWindowPlacement) == NULL);
89 89
90 // Ask the window to save its position, then check that a preference 90 // Ask the window to save its position, then check that a preference
91 // exists. We're technically passing in a pointer to the user prefs 91 // exists.
92 // and not the local state prefs, but a PrefService* is a
93 // PrefService*, and this is a unittest.
94 [controller_ saveWindowPositionToPrefs:prefs]; 92 [controller_ saveWindowPositionToPrefs:prefs];
95 EXPECT_TRUE(prefs->GetDictionary(prefs::kBrowserWindowPlacement) != NULL); 93 EXPECT_TRUE(prefs->GetDictionary(prefs::kBrowserWindowPlacement) != NULL);
96 } 94 }
97 95
98 TEST_F(BrowserWindowControllerTest, TestFullScreenWindow) { 96 TEST_F(BrowserWindowControllerTest, TestFullScreenWindow) {
99 // Confirm that |-createFullscreenWindow| doesn't return nil. 97 // Confirm that |-createFullscreenWindow| doesn't return nil.
100 // See BrowserWindowFullScreenControllerTest for more fullscreen tests. 98 // See BrowserWindowFullScreenControllerTest for more fullscreen tests.
101 EXPECT_TRUE([controller_ createFullscreenWindow]); 99 EXPECT_TRUE([controller_ createFullscreenWindow]);
102 } 100 }
103 101
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 fullscreenWindow_.reset( 657 fullscreenWindow_.reset(
660 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) 658 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400)
661 styleMask:NSBorderlessWindowMask 659 styleMask:NSBorderlessWindowMask
662 backing:NSBackingStoreBuffered 660 backing:NSBackingStoreBuffered
663 defer:NO]); 661 defer:NO]);
664 return fullscreenWindow_.get(); 662 return fullscreenWindow_.get();
665 } 663 }
666 @end 664 @end
667 665
668 /* TODO(???): test other methods of BrowserWindowController */ 666 /* TODO(???): test other methods of BrowserWindowController */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698