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

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

Issue 10055003: Keep emtpy List/Dictionary pref value with non-empty default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for comments in #1 Created 8 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) 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/pref_service_mock_builder.h" 5 #include "chrome/browser/prefs/pref_service_mock_builder.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "chrome/browser/policy/configuration_policy_pref_store.h" 8 #include "chrome/browser/policy/configuration_policy_pref_store.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"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #endif 70 #endif
71 71
72 PrefServiceMockBuilder& 72 PrefServiceMockBuilder&
73 PrefServiceMockBuilder::WithCommandLine(CommandLine* command_line) { 73 PrefServiceMockBuilder::WithCommandLine(CommandLine* command_line) {
74 command_line_prefs_ = new CommandLinePrefStore(command_line); 74 command_line_prefs_ = new CommandLinePrefStore(command_line);
75 return *this; 75 return *this;
76 } 76 }
77 77
78 PrefServiceMockBuilder& 78 PrefServiceMockBuilder&
79 PrefServiceMockBuilder::WithUserFilePrefs(const FilePath& prefs_file) { 79 PrefServiceMockBuilder::WithUserFilePrefs(const FilePath& prefs_file) {
80 user_prefs_ = 80 return WithUserFilePrefs(prefs_file,
81 new JsonPrefStore(prefs_file, 81 BrowserThread::GetMessageLoopProxyForThread(
82 BrowserThread::GetMessageLoopProxyForThread( 82 BrowserThread::FILE));
83 BrowserThread::FILE)); 83 }
84
85 PrefServiceMockBuilder&
86 PrefServiceMockBuilder::WithUserFilePrefs(
87 const FilePath& prefs_file,
88 base::MessageLoopProxy* message_loop_proxy) {
89 user_prefs_ = new JsonPrefStore(prefs_file, message_loop_proxy);
84 return *this; 90 return *this;
85 } 91 }
86 92
87 PrefService* PrefServiceMockBuilder::Create() { 93 PrefService* PrefServiceMockBuilder::Create() {
88 DefaultPrefStore* default_pref_store = new DefaultPrefStore(); 94 DefaultPrefStore* default_pref_store = new DefaultPrefStore();
89 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl(); 95 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl();
90 PrefService* pref_service = 96 PrefService* pref_service =
91 new PrefService( 97 new PrefService(
92 pref_notifier, 98 pref_notifier,
93 new PrefValueStore( 99 new PrefValueStore(
(...skipping 10 matching lines...) Expand all
104 NULL, 110 NULL,
105 false); 111 false);
106 managed_prefs_ = NULL; 112 managed_prefs_ = NULL;
107 extension_prefs_ = NULL; 113 extension_prefs_ = NULL;
108 command_line_prefs_ = NULL; 114 command_line_prefs_ = NULL;
109 user_prefs_ = NULL; 115 user_prefs_ = NULL;
110 recommended_prefs_ = NULL; 116 recommended_prefs_ = NULL;
111 user_prefs_ = new TestingPrefStore; 117 user_prefs_ = new TestingPrefStore;
112 return pref_service; 118 return pref_service;
113 } 119 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_service_mock_builder.h ('k') | chrome/browser/prefs/pref_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698