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

Side by Side Diff: chrome/test/testing_pref_service.cc

Issue 6894020: Adds async interface method to PersistentPrefStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use Notifications. Created 9 years, 8 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) 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/testing_pref_service.h" 5 #include "chrome/test/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_notifier.h"
12 #include "chrome/browser/prefs/pref_value_store.h" 12 #include "chrome/browser/prefs/pref_value_store.h"
13 #include "chrome/browser/prefs/testing_pref_store.h" 13 #include "chrome/browser/prefs/testing_pref_store.h"
14 #include "chrome/test/testing_browser_process.h" 14 #include "chrome/test/testing_browser_process.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 TestingPrefServiceBase::TestingPrefServiceBase( 17 TestingPrefServiceBase::TestingPrefServiceBase(
18 TestingPrefStore* managed_platform_prefs, 18 TestingPrefStore* managed_platform_prefs,
19 TestingPrefStore* user_prefs, 19 TestingPrefStore* user_prefs,
20 TestingPrefStore* recommended_platform_prefs) 20 TestingPrefStore* recommended_platform_prefs)
21 : PrefService(managed_platform_prefs, 21 : PrefService(managed_platform_prefs,
22 NULL, 22 NULL,
23 NULL, 23 NULL,
24 NULL, 24 NULL,
25 user_prefs, 25 user_prefs,
26 recommended_platform_prefs, 26 recommended_platform_prefs,
27 NULL, 27 NULL,
28 new DefaultPrefStore(), 28 new DefaultPrefStore()),
29 NULL),
30 managed_platform_prefs_(managed_platform_prefs), 29 managed_platform_prefs_(managed_platform_prefs),
31 user_prefs_(user_prefs), 30 user_prefs_(user_prefs),
32 recommended_platform_prefs_(recommended_platform_prefs) { 31 recommended_platform_prefs_(recommended_platform_prefs) {
33 } 32 }
34 33
35 TestingPrefServiceBase::~TestingPrefServiceBase() { 34 TestingPrefServiceBase::~TestingPrefServiceBase() {
36 } 35 }
37 36
38 const Value* TestingPrefServiceBase::GetManagedPref(const char* path) const { 37 const Value* TestingPrefServiceBase::GetManagedPref(const char* path) const {
39 return GetPref(managed_platform_prefs_, path); 38 return GetPref(managed_platform_prefs_, path);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 : browser_process_(browser_process) { 103 : browser_process_(browser_process) {
105 browser::RegisterLocalState(&local_state_); 104 browser::RegisterLocalState(&local_state_);
106 EXPECT_FALSE(browser_process->local_state()); 105 EXPECT_FALSE(browser_process->local_state());
107 browser_process->SetLocalState(&local_state_); 106 browser_process->SetLocalState(&local_state_);
108 } 107 }
109 108
110 ScopedTestingLocalState::~ScopedTestingLocalState() { 109 ScopedTestingLocalState::~ScopedTestingLocalState() {
111 EXPECT_EQ(&local_state_, browser_process_->local_state()); 110 EXPECT_EQ(&local_state_, browser_process_->local_state());
112 browser_process_->SetLocalState(NULL); 111 browser_process_->SetLocalState(NULL);
113 } 112 }
114
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698