| 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/ui/webui/options/preferences_browsertest.h" | 5 #include "chrome/browser/ui/webui/options/preferences_browsertest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <iostream> | 9 #include <iostream> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 SetPref(name, type, &value, true, &observed_json); | 917 SetPref(name, type, &value, true, &observed_json); |
| 918 } | 918 } |
| 919 | 919 |
| 920 void VerifyCurrentProxyServer(const std::string& expected_server, | 920 void VerifyCurrentProxyServer(const std::string& expected_server, |
| 921 onc::ONCSource expected_source) { | 921 onc::ONCSource expected_source) { |
| 922 const chromeos::NetworkState* network = GetDefaultNetwork(); | 922 const chromeos::NetworkState* network = GetDefaultNetwork(); |
| 923 ASSERT_TRUE(network); | 923 ASSERT_TRUE(network); |
| 924 onc::ONCSource actual_source; | 924 onc::ONCSource actual_source; |
| 925 std::unique_ptr<ProxyConfigDictionary> proxy_dict = | 925 std::unique_ptr<ProxyConfigDictionary> proxy_dict = |
| 926 chromeos::proxy_config::GetProxyConfigForNetwork( | 926 chromeos::proxy_config::GetProxyConfigForNetwork( |
| 927 pref_service_, g_browser_process->local_state(), *network, | 927 g_browser_process->local_state(), pref_service_, *network, |
| 928 &actual_source); | 928 &actual_source); |
| 929 ASSERT_TRUE(proxy_dict); | 929 ASSERT_TRUE(proxy_dict); |
| 930 std::string actual_proxy_server; | 930 std::string actual_proxy_server; |
| 931 EXPECT_TRUE(proxy_dict->GetProxyServer(&actual_proxy_server)); | 931 EXPECT_TRUE(proxy_dict->GetProxyServer(&actual_proxy_server)); |
| 932 EXPECT_EQ(expected_server, actual_proxy_server); | 932 EXPECT_EQ(expected_server, actual_proxy_server); |
| 933 EXPECT_EQ(expected_source, actual_source); | 933 EXPECT_EQ(expected_source, actual_source); |
| 934 } | 934 } |
| 935 }; | 935 }; |
| 936 | 936 |
| 937 // Verifies that proxy settings are correctly pushed to JavaScript during | 937 // Verifies that proxy settings are correctly pushed to JavaScript during |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 base::FundamentalValue(3)); | 1094 base::FundamentalValue(3)); |
| 1095 SetProxyPref(chromeos::proxy_cros_settings_parser::kProxySocksPort, | 1095 SetProxyPref(chromeos::proxy_cros_settings_parser::kProxySocksPort, |
| 1096 base::FundamentalValue(4)); | 1096 base::FundamentalValue(4)); |
| 1097 | 1097 |
| 1098 VerifyCurrentProxyServer( | 1098 VerifyCurrentProxyServer( |
| 1099 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", | 1099 "http=a.com:1;https=4.3.2.1:2;ftp=c.com:3;socks=socks4://d.com:4", |
| 1100 onc::ONC_SOURCE_NONE); | 1100 onc::ONC_SOURCE_NONE); |
| 1101 } | 1101 } |
| 1102 | 1102 |
| 1103 #endif | 1103 #endif |
| OLD | NEW |