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

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

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again, previous had unrelated broken win_rel test. Created 7 years, 12 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/policy/mock_configuration_policy_provider.h" 6 #include "chrome/browser/policy/mock_configuration_policy_provider.h"
7 #include "chrome/browser/policy/policy_map.h" 7 #include "chrome/browser/policy/policy_map.h"
8 #include "chrome/browser/policy/policy_service_impl.h" 8 #include "chrome/browser/policy/policy_service_impl.h"
9 #include "chrome/browser/prefs/browser_prefs.h" 9 #include "chrome/browser/prefs/browser_prefs.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 virtual void TearDown() OVERRIDE { 91 virtual void TearDown() OVERRIDE {
92 provider_.Shutdown(); 92 provider_.Shutdown();
93 } 93 }
94 94
95 PrefService* CreatePrefService(bool with_managed_policies) { 95 PrefService* CreatePrefService(bool with_managed_policies) {
96 PrefServiceMockBuilder builder; 96 PrefServiceMockBuilder builder;
97 builder.WithCommandLine(&command_line_); 97 builder.WithCommandLine(&command_line_);
98 if (with_managed_policies) 98 if (with_managed_policies)
99 builder.WithManagedPolicies(policy_service_.get()); 99 builder.WithManagedPolicies(policy_service_.get());
100 PrefService* prefs = builder.Create(); 100 PrefServiceSyncable* prefs = builder.CreateSyncable();
101 chrome::RegisterUserPrefs(prefs); 101 chrome::RegisterUserPrefs(prefs);
102 return prefs; 102 return prefs;
103 } 103 }
104 104
105 CommandLine command_line_; 105 CommandLine command_line_;
106 MockConfigurationPolicyProvider provider_; 106 MockConfigurationPolicyProvider provider_;
107 scoped_ptr<PolicyServiceImpl> policy_service_; 107 scoped_ptr<PolicyServiceImpl> policy_service_;
108 }; 108 };
109 109
110 TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) { 110 TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 // Try a second time time with the managed PrefStore in place, the 210 // Try a second time time with the managed PrefStore in place, the
211 // auto-detect should be overridden. The default pref store must be 211 // auto-detect should be overridden. The default pref store must be
212 // in place with the appropriate default value for this to work. 212 // in place with the appropriate default value for this to work.
213 prefs.reset(CreatePrefService(true)); 213 prefs.reset(CreatePrefService(true));
214 ProxyConfigDictionary dict2(prefs->GetDictionary(prefs::kProxy)); 214 ProxyConfigDictionary dict2(prefs->GetDictionary(prefs::kProxy));
215 assertProxyModeWithoutParams(dict2, ProxyPrefs::MODE_DIRECT); 215 assertProxyModeWithoutParams(dict2, ProxyPrefs::MODE_DIRECT);
216 } 216 }
217 217
218 } // namespace policy 218 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_value_store_unittest.cc ('k') | chrome/browser/prefs/scoped_user_pref_update_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698