| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 assertBypassList(dict, std::string()); | 77 assertBypassList(dict, std::string()); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace | 80 } // namespace |
| 81 | 81 |
| 82 class ProxyPolicyTest : public testing::Test { | 82 class ProxyPolicyTest : public testing::Test { |
| 83 protected: | 83 protected: |
| 84 ProxyPolicyTest() | 84 ProxyPolicyTest() |
| 85 : command_line_(CommandLine::NO_PROGRAM) {} | 85 : command_line_(CommandLine::NO_PROGRAM) {} |
| 86 | 86 |
| 87 virtual void SetUp() OVERRIDE { | 87 virtual void SetUp() override { |
| 88 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 88 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 89 .WillRepeatedly(Return(true)); | 89 .WillRepeatedly(Return(true)); |
| 90 | 90 |
| 91 PolicyServiceImpl::Providers providers; | 91 PolicyServiceImpl::Providers providers; |
| 92 providers.push_back(&provider_); | 92 providers.push_back(&provider_); |
| 93 policy_service_.reset(new PolicyServiceImpl(providers)); | 93 policy_service_.reset(new PolicyServiceImpl(providers)); |
| 94 provider_.Init(); | 94 provider_.Init(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual void TearDown() OVERRIDE { | 97 virtual void TearDown() override { |
| 98 provider_.Shutdown(); | 98 provider_.Shutdown(); |
| 99 } | 99 } |
| 100 | 100 |
| 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); |
| (...skipping 117 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 |