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

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

Issue 1305213009: Componentize PrefSyncableService and support classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_service_syncable
Patch Set: Add missing dependency on //sync:test_support_sync_api for unit tests with gn Created 5 years, 3 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
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"
8 #include "components/pref_registry/pref_registry_syncable.h" 7 #include "components/pref_registry/pref_registry_syncable.h"
8 #include "components/syncable_prefs/testing_pref_service_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 // Unit tests for SessionStartupPref. 12 // Unit tests for SessionStartupPref.
13 class SessionStartupPrefTest : public testing::Test { 13 class SessionStartupPrefTest : public testing::Test {
14 public: 14 public:
15 void SetUp() override { 15 void SetUp() override {
16 pref_service_.reset(new TestingPrefServiceSyncable); 16 pref_service_.reset(new TestingPrefServiceSyncable);
17 SessionStartupPref::RegisterProfilePrefs(registry()); 17 SessionStartupPref::RegisterProfilePrefs(registry());
18 registry()->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true); 18 registry()->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // using the pref service directly. 149 // using the pref service directly.
150 pref_service_->SetInteger(prefs::kRestoreOnStartup, /*kPrefValueHomePage*/ 0); 150 pref_service_->SetInteger(prefs::kRestoreOnStartup, /*kPrefValueHomePage*/ 0);
151 pref_service_->SetString(prefs::kHomePage, "http://chromium.org/"); 151 pref_service_->SetString(prefs::kHomePage, "http://chromium.org/");
152 pref_service_->SetBoolean(prefs::kHomePageIsNewTabPage, true); 152 pref_service_->SetBoolean(prefs::kHomePageIsNewTabPage, true);
153 153
154 SessionStartupPref pref = SessionStartupPref::GetStartupPref( 154 SessionStartupPref pref = SessionStartupPref::GetStartupPref(
155 pref_service_.get()); 155 pref_service_.get());
156 156
157 EXPECT_EQ(SessionStartupPref::DEFAULT, pref.type); 157 EXPECT_EQ(SessionStartupPref::DEFAULT, pref.type);
158 } 158 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/proxy_policy_unittest.cc ('k') | chrome/browser/prefs/synced_pref_change_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698