| 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 #include "chrome/test/base/testing_pref_service.h" | 5 #include "chrome/test/base/testing_pref_service.h" |
| 6 | 6 |
| 7 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 7 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
| 8 #include "chrome/browser/prefs/browser_prefs.h" | 8 #include "chrome/browser/prefs/browser_prefs.h" |
| 9 #include "chrome/browser/prefs/command_line_pref_store.h" | 9 #include "chrome/browser/prefs/command_line_pref_store.h" |
| 10 #include "chrome/browser/prefs/default_pref_store.h" | 10 #include "chrome/browser/prefs/default_pref_store.h" |
| 11 #include "chrome/browser/prefs/pref_notifier.h" | 11 #include "chrome/browser/prefs/pref_model_associator.h" |
| 12 #include "chrome/browser/prefs/pref_notifier_impl.h" |
| 12 #include "chrome/browser/prefs/pref_value_store.h" | 13 #include "chrome/browser/prefs/pref_value_store.h" |
| 13 #include "chrome/browser/prefs/testing_pref_store.h" | 14 #include "chrome/browser/prefs/testing_pref_store.h" |
| 14 #include "chrome/test/base/testing_browser_process.h" | 15 #include "chrome/test/base/testing_browser_process.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| 17 TestingPrefServiceBase::TestingPrefServiceBase( | 18 TestingPrefServiceBase::TestingPrefServiceBase( |
| 18 TestingPrefStore* managed_platform_prefs, | 19 TestingPrefStore* managed_platform_prefs, |
| 19 TestingPrefStore* user_prefs, | 20 TestingPrefStore* user_prefs, |
| 20 TestingPrefStore* recommended_platform_prefs) | 21 TestingPrefStore* recommended_platform_prefs) |
| 21 : PrefService(managed_platform_prefs, | 22 : PrefService( |
| 22 NULL, | 23 new PrefValueStore(managed_platform_prefs, |
| 23 NULL, | 24 NULL, |
| 24 NULL, | 25 NULL, |
| 25 user_prefs, | 26 NULL, |
| 26 recommended_platform_prefs, | 27 user_prefs, |
| 27 NULL, | 28 recommended_platform_prefs, |
| 28 new DefaultPrefStore(), | 29 NULL, |
| 29 false), | 30 new DefaultPrefStore(), |
| 31 new PrefModelAssociator(), |
| 32 new PrefNotifierImpl()), |
| 33 false), |
| 30 managed_platform_prefs_(managed_platform_prefs), | 34 managed_platform_prefs_(managed_platform_prefs), |
| 31 user_prefs_(user_prefs), | 35 user_prefs_(user_prefs), |
| 32 recommended_platform_prefs_(recommended_platform_prefs) { | 36 recommended_platform_prefs_(recommended_platform_prefs) { |
| 33 } | 37 } |
| 34 | 38 |
| 35 TestingPrefServiceBase::~TestingPrefServiceBase() { | 39 TestingPrefServiceBase::~TestingPrefServiceBase() { |
| 36 } | 40 } |
| 37 | 41 |
| 38 const Value* TestingPrefServiceBase::GetManagedPref(const char* path) const { | 42 const Value* TestingPrefServiceBase::GetManagedPref(const char* path) const { |
| 39 return GetPref(managed_platform_prefs_, path); | 43 return GetPref(managed_platform_prefs_, path); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 : browser_process_(browser_process) { | 108 : browser_process_(browser_process) { |
| 105 browser::RegisterLocalState(&local_state_); | 109 browser::RegisterLocalState(&local_state_); |
| 106 EXPECT_FALSE(browser_process->local_state()); | 110 EXPECT_FALSE(browser_process->local_state()); |
| 107 browser_process->SetLocalState(&local_state_); | 111 browser_process->SetLocalState(&local_state_); |
| 108 } | 112 } |
| 109 | 113 |
| 110 ScopedTestingLocalState::~ScopedTestingLocalState() { | 114 ScopedTestingLocalState::~ScopedTestingLocalState() { |
| 111 EXPECT_EQ(&local_state_, browser_process_->local_state()); | 115 EXPECT_EQ(&local_state_, browser_process_->local_state()); |
| 112 browser_process_->SetLocalState(NULL); | 116 browser_process_->SetLocalState(NULL); |
| 113 } | 117 } |
| OLD | NEW |