| 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 "chrome/browser/chromeos/proxy_config_service_impl.h" | 5 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 : ui_thread_(BrowserThread::UI, &loop_), | 214 : ui_thread_(BrowserThread::UI, &loop_), |
| 215 io_thread_(BrowserThread::IO, &loop_) {} | 215 io_thread_(BrowserThread::IO, &loop_) {} |
| 216 | 216 |
| 217 virtual void SetUp() { | 217 virtual void SetUp() { |
| 218 DBusThreadManager::InitializeWithStub(); | 218 DBusThreadManager::InitializeWithStub(); |
| 219 NetworkHandler::Initialize(); | 219 NetworkHandler::Initialize(); |
| 220 | 220 |
| 221 SetUpNetwork(); | 221 SetUpNetwork(); |
| 222 | 222 |
| 223 PrefProxyConfigTrackerImpl::RegisterPrefs(pref_service_.registry()); | 223 PrefProxyConfigTrackerImpl::RegisterPrefs(pref_service_.registry()); |
| 224 ProxyConfigServiceImpl::RegisterPrefs(pref_service_.registry()); | |
| 225 proxy_config_service_.reset(new ChromeProxyConfigService(NULL)); | 224 proxy_config_service_.reset(new ChromeProxyConfigService(NULL)); |
| 226 config_service_impl_.reset(new ProxyConfigServiceImpl(&pref_service_)); | 225 // Create a ProxyConfigServiceImpl like for the system request context. |
| 226 config_service_impl_.reset( |
| 227 new ProxyConfigServiceImpl(NULL, // no profile prefs |
| 228 &pref_service_)); |
| 227 config_service_impl_->SetChromeProxyConfigService( | 229 config_service_impl_->SetChromeProxyConfigService( |
| 228 proxy_config_service_.get()); | 230 proxy_config_service_.get()); |
| 229 // SetChromeProxyConfigService triggers update of initial prefs proxy | 231 // SetChromeProxyConfigService triggers update of initial prefs proxy |
| 230 // config by tracker to chrome proxy config service, so flush all pending | 232 // config by tracker to chrome proxy config service, so flush all pending |
| 231 // tasks so that tests start fresh. | 233 // tasks so that tests start fresh. |
| 232 loop_.RunUntilIdle(); | 234 loop_.RunUntilIdle(); |
| 233 } | 235 } |
| 234 | 236 |
| 235 void SetUpNetwork() { | 237 void SetUpNetwork() { |
| 236 ShillProfileClient::TestInterface* profile_test = | 238 ShillProfileClient::TestInterface* profile_test = |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 pref_service_.RemoveRecommendedPref(prefs::kProxy); | 442 pref_service_.RemoveRecommendedPref(prefs::kProxy); |
| 441 SyncGetLatestProxyConfig(&actual_config); | 443 SyncGetLatestProxyConfig(&actual_config); |
| 442 EXPECT_EQ(network_params.auto_detect, actual_config.auto_detect()); | 444 EXPECT_EQ(network_params.auto_detect, actual_config.auto_detect()); |
| 443 EXPECT_EQ(network_params.pac_url, actual_config.pac_url()); | 445 EXPECT_EQ(network_params.pac_url, actual_config.pac_url()); |
| 444 EXPECT_TRUE(network_params.proxy_rules.Matches( | 446 EXPECT_TRUE(network_params.proxy_rules.Matches( |
| 445 actual_config.proxy_rules())); | 447 actual_config.proxy_rules())); |
| 446 } | 448 } |
| 447 } | 449 } |
| 448 | 450 |
| 449 } // namespace chromeos | 451 } // namespace chromeos |
| OLD | NEW |