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

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

Issue 16296002: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "chrome/browser/policy/mock_configuration_policy_provider.h" 7 #include "chrome/browser/policy/mock_configuration_policy_provider.h"
8 #include "chrome/browser/policy/policy_map.h" 8 #include "chrome/browser/policy/policy_map.h"
9 #include "chrome/browser/policy/policy_service_impl.h" 9 #include "chrome/browser/policy/policy_service_impl.h"
10 #include "chrome/browser/prefs/browser_prefs.h" 10 #include "chrome/browser/prefs/browser_prefs.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 provider_.Shutdown(); 94 provider_.Shutdown();
95 } 95 }
96 96
97 PrefService* CreatePrefService(bool with_managed_policies) { 97 PrefService* CreatePrefService(bool with_managed_policies) {
98 PrefServiceMockBuilder builder; 98 PrefServiceMockBuilder builder;
99 builder.WithCommandLine(&command_line_); 99 builder.WithCommandLine(&command_line_);
100 if (with_managed_policies) 100 if (with_managed_policies)
101 builder.WithManagedPolicies(policy_service_.get()); 101 builder.WithManagedPolicies(policy_service_.get());
102 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( 102 scoped_refptr<user_prefs::PrefRegistrySyncable> registry(
103 new user_prefs::PrefRegistrySyncable); 103 new user_prefs::PrefRegistrySyncable);
104 PrefServiceSyncable* prefs = builder.CreateSyncable(registry); 104 PrefServiceSyncable* prefs = builder.CreateSyncable(registry.get());
105 chrome::RegisterUserPrefs(registry); 105 chrome::RegisterUserPrefs(registry.get());
106 return prefs; 106 return prefs;
107 } 107 }
108 108
109 CommandLine command_line_; 109 CommandLine command_line_;
110 MockConfigurationPolicyProvider provider_; 110 MockConfigurationPolicyProvider provider_;
111 scoped_ptr<PolicyServiceImpl> policy_service_; 111 scoped_ptr<PolicyServiceImpl> policy_service_;
112 }; 112 };
113 113
114 TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) { 114 TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) {
115 command_line_.AppendSwitchASCII(switches::kProxyBypassList, "123"); 115 command_line_.AppendSwitchASCII(switches::kProxyBypassList, "123");
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 // Try a second time time with the managed PrefStore in place, the 214 // Try a second time time with the managed PrefStore in place, the
215 // auto-detect should be overridden. The default pref store must be 215 // auto-detect should be overridden. The default pref store must be
216 // in place with the appropriate default value for this to work. 216 // in place with the appropriate default value for this to work.
217 prefs.reset(CreatePrefService(true)); 217 prefs.reset(CreatePrefService(true));
218 ProxyConfigDictionary dict2(prefs->GetDictionary(prefs::kProxy)); 218 ProxyConfigDictionary dict2(prefs->GetDictionary(prefs::kProxy));
219 assertProxyModeWithoutParams(dict2, ProxyPrefs::MODE_DIRECT); 219 assertProxyModeWithoutParams(dict2, ProxyPrefs::MODE_DIRECT);
220 } 220 }
221 221
222 } // namespace policy 222 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/prefs/pref_service_syncable.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698