| OLD | NEW |
| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "chrome/browser/prefs/browser_prefs.h" | 10 #include "chrome/browser/prefs/browser_prefs.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 scoped_ptr<PrefService> CreatePrefService(bool with_managed_policies) { | 101 scoped_ptr<PrefService> CreatePrefService(bool with_managed_policies) { |
| 102 PrefServiceMockFactory factory; | 102 PrefServiceMockFactory factory; |
| 103 factory.SetCommandLine(&command_line_); | 103 factory.SetCommandLine(&command_line_); |
| 104 if (with_managed_policies) | 104 if (with_managed_policies) |
| 105 factory.SetManagedPolicies(policy_service_.get()); | 105 factory.SetManagedPolicies(policy_service_.get()); |
| 106 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( | 106 scoped_refptr<user_prefs::PrefRegistrySyncable> registry( |
| 107 new user_prefs::PrefRegistrySyncable); | 107 new user_prefs::PrefRegistrySyncable); |
| 108 scoped_ptr<PrefServiceSyncable> prefs = | 108 scoped_ptr<PrefServiceSyncable> prefs = |
| 109 factory.CreateSyncable(registry.get()); | 109 factory.CreateSyncable(registry.get()); |
| 110 chrome::RegisterUserProfilePrefs(registry.get()); | 110 chrome::RegisterUserProfilePrefs(registry.get()); |
| 111 return prefs.PassAs<PrefService>(); | 111 return prefs.Pass(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 base::MessageLoop loop_; | 114 base::MessageLoop loop_; |
| 115 CommandLine command_line_; | 115 CommandLine command_line_; |
| 116 MockConfigurationPolicyProvider provider_; | 116 MockConfigurationPolicyProvider provider_; |
| 117 scoped_ptr<PolicyServiceImpl> policy_service_; | 117 scoped_ptr<PolicyServiceImpl> policy_service_; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) { | 120 TEST_F(ProxyPolicyTest, OverridesCommandLineOptions) { |
| 121 command_line_.AppendSwitchASCII(switches::kProxyBypassList, "123"); | 121 command_line_.AppendSwitchASCII(switches::kProxyBypassList, "123"); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 // Try a second time time with the managed PrefStore in place, the | 226 // Try a second time time with the managed PrefStore in place, the |
| 227 // auto-detect should be overridden. The default pref store must be | 227 // auto-detect should be overridden. The default pref store must be |
| 228 // in place with the appropriate default value for this to work. | 228 // in place with the appropriate default value for this to work. |
| 229 prefs = CreatePrefService(true); | 229 prefs = CreatePrefService(true); |
| 230 ProxyConfigDictionary dict2(prefs->GetDictionary(prefs::kProxy)); | 230 ProxyConfigDictionary dict2(prefs->GetDictionary(prefs::kProxy)); |
| 231 assertProxyModeWithoutParams(dict2, ProxyPrefs::MODE_DIRECT); | 231 assertProxyModeWithoutParams(dict2, ProxyPrefs::MODE_DIRECT); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace policy | 234 } // namespace policy |
| OLD | NEW |