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

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: '' 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 "base/scoped_ptr.h" 6 #include "base/scoped_ptr.h"
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/browser_window.h" 8 #include "chrome/browser/browser_window.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/sync/sync_ui_util.h" 10 #include "chrome/browser/sync/sync_ui_util.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const DictionaryValue* browser_window_placement = 88 const DictionaryValue* browser_window_placement =
89 prefs->GetDictionary(prefs::kBrowserWindowPlacement); 89 prefs->GetDictionary(prefs::kBrowserWindowPlacement);
90 ASSERT_TRUE(browser_window_placement); 90 ASSERT_TRUE(browser_window_placement);
91 EXPECT_TRUE(browser_window_placement->empty()); 91 EXPECT_TRUE(browser_window_placement->empty());
92 92
93 // Ask the window to save its position, then check that a preference 93 // Ask the window to save its position, then check that a preference
94 // exists. We're technically passing in a pointer to the user prefs 94 // exists.
95 // and not the local state prefs, but a PrefService* is a
96 // PrefService*, and this is a unittest.
97 [controller_ saveWindowPositionToPrefs:prefs]; 95 [controller_ saveWindowPositionToPrefs:prefs];
98 browser_window_placement = 96 browser_window_placement =
99 prefs->GetDictionary(prefs::kBrowserWindowPlacement); 97 prefs->GetDictionary(prefs::kBrowserWindowPlacement);
100 ASSERT_TRUE(browser_window_placement); 98 ASSERT_TRUE(browser_window_placement);
101 EXPECT_FALSE(browser_window_placement->empty()); 99 EXPECT_FALSE(browser_window_placement->empty());
102 } 100 }
103 101
104 TEST_F(BrowserWindowControllerTest, TestFullScreenWindow) { 102 TEST_F(BrowserWindowControllerTest, TestFullScreenWindow) {
105 // Confirm that |-createFullscreenWindow| doesn't return nil. 103 // Confirm that |-createFullscreenWindow| doesn't return nil.
106 // See BrowserWindowFullScreenControllerTest for more fullscreen tests. 104 // See BrowserWindowFullScreenControllerTest for more fullscreen tests.
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 fullscreenWindow_.reset( 663 fullscreenWindow_.reset(
666 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400) 664 [[NSWindow alloc] initWithContentRect:NSMakeRect(0,0,400,400)
667 styleMask:NSBorderlessWindowMask 665 styleMask:NSBorderlessWindowMask
668 backing:NSBackingStoreBuffered 666 backing:NSBackingStoreBuffered
669 defer:NO]); 667 defer:NO]);
670 return fullscreenWindow_.get(); 668 return fullscreenWindow_.get();
671 } 669 }
672 @end 670 @end
673 671
674 /* TODO(???): test other methods of BrowserWindowController */ 672 /* TODO(???): test other methods of BrowserWindowController */
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | chrome/browser/ui/cocoa/dev_tools_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698