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

Side by Side Diff: chrome/browser/prefs/session_startup_pref_unittest.cc

Issue 18199003: Allow Chrome OS login profile to have different default pref values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/prefs/session_startup_pref.h" 5 #include "chrome/browser/prefs/session_startup_pref.h"
6 #include "chrome/common/pref_names.h" 6 #include "chrome/common/pref_names.h"
7 #include "chrome/test/base/testing_pref_service_syncable.h" 7 #include "chrome/test/base/testing_pref_service_syncable.h"
8 #include "components/user_prefs/pref_registry_syncable.h" 8 #include "components/user_prefs/pref_registry_syncable.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 #if defined(OS_MACOSX) 12 #if defined(OS_MACOSX)
13 #include "chrome/browser/ui/cocoa/window_restore_utils.h" 13 #include "chrome/browser/ui/cocoa/window_restore_utils.h"
14 #endif 14 #endif
15 15
16 // Unit tests for SessionStartupPref. 16 // Unit tests for SessionStartupPref.
17 class SessionStartupPrefTest : public testing::Test { 17 class SessionStartupPrefTest : public testing::Test {
18 public: 18 public:
19 virtual void SetUp() { 19 virtual void SetUp() {
20 pref_service_.reset(new TestingPrefServiceSyncable); 20 pref_service_.reset(new TestingPrefServiceSyncable);
21 SessionStartupPref::RegisterUserPrefs(registry()); 21 SessionStartupPref::RegisterProfilePrefs(registry());
22 registry()->RegisterBooleanPref( 22 registry()->RegisterBooleanPref(
23 prefs::kHomePageIsNewTabPage, 23 prefs::kHomePageIsNewTabPage,
24 true, 24 true,
25 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 25 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
26 // Make the tests independent of the Mac startup pref migration (see 26 // Make the tests independent of the Mac startup pref migration (see
27 // SessionStartupPref::MigrateMacDefaultPrefIfNecessary). 27 // SessionStartupPref::MigrateMacDefaultPrefIfNecessary).
28 registry()->RegisterStringPref( 28 registry()->RegisterStringPref(
29 prefs::kProfileCreatedByVersion, 29 prefs::kProfileCreatedByVersion,
30 "22.0.0.0", 30 "22.0.0.0",
31 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 31 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 // Trigger the migration. 195 // Trigger the migration.
196 SessionStartupPref pref = SessionStartupPref::GetStartupPref( 196 SessionStartupPref pref = SessionStartupPref::GetStartupPref(
197 pref_service_.get()); 197 pref_service_.get());
198 198
199 // The pref is now explicit. 199 // The pref is now explicit.
200 EXPECT_EQ(SessionStartupPref::LAST, pref.type); 200 EXPECT_EQ(SessionStartupPref::LAST, pref.type);
201 EXPECT_FALSE(SessionStartupPref::TypeIsDefault(pref_service_.get())); 201 EXPECT_FALSE(SessionStartupPref::TypeIsDefault(pref_service_.get()));
202 } 202 }
203 #endif 203 #endif
OLDNEW
« no previous file with comments | « chrome/browser/prefs/session_startup_pref.cc ('k') | chrome/browser/printing/cloud_print/cloud_print_url.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698