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(new PrefNotifierImpl(), |
22 NULL, | |
23 NULL, | |
24 NULL, | |
25 user_prefs, | 23 user_prefs, |
26 recommended_platform_prefs, | |
27 NULL, | |
28 new DefaultPrefStore(), | 24 new DefaultPrefStore(), |
25 new PrefModelAssociator(), | |
Mattias Nissler (ping if slow)
2011/11/18 14:57:07
same here: Do we really need a non-null associator
mnaganov (inactive)
2011/11/21 14:52:20
Not sure, but I trust you. Set to NULL.
mnaganov (inactive)
2011/11/21 16:36:39
I have found the reason: ProfileSyncServicePrefere
| |
26 new PrefValueStore( | |
27 managed_platform_prefs, | |
28 NULL, | |
29 NULL, | |
30 NULL, | |
31 PrefService::user_pref_store_.get(), | |
Mattias Nissler (ping if slow)
2011/11/18 14:57:07
How can this work? The PrefValueStore ctor() run b
mnaganov (inactive)
2011/11/21 14:52:20
Oh, right. Of course, call semantics requires argu
| |
32 recommended_platform_prefs, | |
33 NULL, | |
34 PrefService::default_store_.get(), | |
35 PrefService::pref_sync_associator_.get(), | |
36 PrefService::pref_notifier_.get()), | |
29 false), | 37 false), |
30 managed_platform_prefs_(managed_platform_prefs), | 38 managed_platform_prefs_(managed_platform_prefs), |
31 user_prefs_(user_prefs), | 39 user_prefs_(user_prefs), |
32 recommended_platform_prefs_(recommended_platform_prefs) { | 40 recommended_platform_prefs_(recommended_platform_prefs) { |
33 } | 41 } |
34 | 42 |
35 TestingPrefServiceBase::~TestingPrefServiceBase() { | 43 TestingPrefServiceBase::~TestingPrefServiceBase() { |
36 } | 44 } |
37 | 45 |
38 const Value* TestingPrefServiceBase::GetManagedPref(const char* path) const { | 46 const Value* TestingPrefServiceBase::GetManagedPref(const char* path) const { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 : browser_process_(browser_process) { | 112 : browser_process_(browser_process) { |
105 browser::RegisterLocalState(&local_state_); | 113 browser::RegisterLocalState(&local_state_); |
106 EXPECT_FALSE(browser_process->local_state()); | 114 EXPECT_FALSE(browser_process->local_state()); |
107 browser_process->SetLocalState(&local_state_); | 115 browser_process->SetLocalState(&local_state_); |
108 } | 116 } |
109 | 117 |
110 ScopedTestingLocalState::~ScopedTestingLocalState() { | 118 ScopedTestingLocalState::~ScopedTestingLocalState() { |
111 EXPECT_EQ(&local_state_, browser_process_->local_state()); | 119 EXPECT_EQ(&local_state_, browser_process_->local_state()); |
112 browser_process_->SetLocalState(NULL); | 120 browser_process_->SetLocalState(NULL); |
113 } | 121 } |
OLD | NEW |