| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |