OLD | NEW |
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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" | 7 #import "chrome/browser/ui/cocoa/window_size_autosaver.h" |
8 | 8 |
9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 CocoaProfileTest::SetUp(); | 22 CocoaProfileTest::SetUp(); |
23 path_ = "WindowSizeAutosaverTest"; | 23 path_ = "WindowSizeAutosaverTest"; |
24 window_ = | 24 window_ = |
25 [[NSWindow alloc] initWithContentRect:NSMakeRect(100, 101, 150, 151) | 25 [[NSWindow alloc] initWithContentRect:NSMakeRect(100, 101, 150, 151) |
26 styleMask:NSTitledWindowMask| | 26 styleMask:NSTitledWindowMask| |
27 NSResizableWindowMask | 27 NSResizableWindowMask |
28 backing:NSBackingStoreBuffered | 28 backing:NSBackingStoreBuffered |
29 defer:NO]; | 29 defer:NO]; |
30 // TODO(joi): Do all registration up front. | 30 // TODO(joi): Do all registration up front. |
31 static_cast<user_prefs::PrefRegistrySyncable*>( | 31 static_cast<user_prefs::PrefRegistrySyncable*>( |
32 profile()->GetPrefs()->DeprecatedGetPrefRegistry())-> | 32 profile()->GetPrefs()->DeprecatedGetPrefRegistry()) |
33 RegisterDictionaryPref( | 33 ->RegisterDictionaryPref(path_); |
34 path_, | |
35 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
36 } | 34 } |
37 | 35 |
38 void TearDown() override { | 36 void TearDown() override { |
39 [window_ close]; | 37 [window_ close]; |
40 CocoaProfileTest::TearDown(); | 38 CocoaProfileTest::TearDown(); |
41 } | 39 } |
42 | 40 |
43 public: | 41 public: |
44 NSWindow* window_; | 42 NSWindow* window_; |
45 const char* path_; | 43 const char* path_; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 int x1, y1, x2, y2; | 201 int x1, y1, x2, y2; |
204 EXPECT_FALSE(windowPref->GetInteger("x", &x1)); | 202 EXPECT_FALSE(windowPref->GetInteger("x", &x1)); |
205 EXPECT_FALSE(windowPref->GetInteger("y", &x1)); | 203 EXPECT_FALSE(windowPref->GetInteger("y", &x1)); |
206 ASSERT_FALSE(windowPref->GetInteger("left", &x1)); | 204 ASSERT_FALSE(windowPref->GetInteger("left", &x1)); |
207 ASSERT_FALSE(windowPref->GetInteger("right", &x2)); | 205 ASSERT_FALSE(windowPref->GetInteger("right", &x2)); |
208 ASSERT_FALSE(windowPref->GetInteger("top", &y1)); | 206 ASSERT_FALSE(windowPref->GetInteger("top", &y1)); |
209 ASSERT_FALSE(windowPref->GetInteger("bottom", &y2)); | 207 ASSERT_FALSE(windowPref->GetInteger("bottom", &y2)); |
210 } | 208 } |
211 | 209 |
212 } // namespace | 210 } // namespace |
OLD | NEW |