| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
| 12 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
| 13 #include "base/logging.h" | 14 #include "base/logging.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
| 16 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
| 17 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 18 #include "chrome/browser/chromeos/net/proxy_config_handler.h" | 19 #include "chrome/browser/chromeos/net/proxy_config_handler.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 // if 'UseSharedProxies' is set to false. | 507 // if 'UseSharedProxies' is set to false. |
| 507 // See https://crbug.com/454966 . | 508 // See https://crbug.com/454966 . |
| 508 TEST_F(ProxyConfigServiceImplTest, SharedEthernetAndUserPolicy) { | 509 TEST_F(ProxyConfigServiceImplTest, SharedEthernetAndUserPolicy) { |
| 509 SetUpSharedEthernet(); | 510 SetUpSharedEthernet(); |
| 510 SetUpProxyConfigService(&profile_prefs_); | 511 SetUpProxyConfigService(&profile_prefs_); |
| 511 | 512 |
| 512 std::unique_ptr<base::DictionaryValue> ethernet_policy( | 513 std::unique_ptr<base::DictionaryValue> ethernet_policy( |
| 513 chromeos::onc::ReadDictionaryFromJson(kEthernetPolicy)); | 514 chromeos::onc::ReadDictionaryFromJson(kEthernetPolicy)); |
| 514 | 515 |
| 515 std::unique_ptr<base::ListValue> network_configs(new base::ListValue); | 516 std::unique_ptr<base::ListValue> network_configs(new base::ListValue); |
| 516 network_configs->Append(ethernet_policy.release()); | 517 network_configs->Append(std::move(ethernet_policy)); |
| 517 | 518 |
| 518 profile_prefs_.SetUserPref(prefs::kUseSharedProxies, | 519 profile_prefs_.SetUserPref(prefs::kUseSharedProxies, |
| 519 new base::FundamentalValue(false)); | 520 new base::FundamentalValue(false)); |
| 520 profile_prefs_.SetManagedPref(prefs::kOpenNetworkConfiguration, | 521 profile_prefs_.SetManagedPref(prefs::kOpenNetworkConfiguration, |
| 521 network_configs.release()); | 522 network_configs.release()); |
| 522 | 523 |
| 523 net::ProxyConfig actual_config; | 524 net::ProxyConfig actual_config; |
| 524 SyncGetLatestProxyConfig(&actual_config); | 525 SyncGetLatestProxyConfig(&actual_config); |
| 525 net::ProxyConfig expected_config = | 526 net::ProxyConfig expected_config = |
| 526 net::ProxyConfig::CreateFromCustomPacURL(GURL("http://domain.com/x")); | 527 net::ProxyConfig::CreateFromCustomPacURL(GURL("http://domain.com/x")); |
| 527 EXPECT_TRUE(expected_config.Equals(actual_config)); | 528 EXPECT_TRUE(expected_config.Equals(actual_config)); |
| 528 } | 529 } |
| 529 | 530 |
| 530 } // namespace chromeos | 531 } // namespace chromeos |
| OLD | NEW |