OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/proxy/proxy_config_service_linux.h" | 5 #include "net/proxy/proxy_config_service_linux.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 Reset(); | 98 Reset(); |
99 } | 99 } |
100 | 100 |
101 // Zeros all environment values. | 101 // Zeros all environment values. |
102 void Reset() { | 102 void Reset() { |
103 EnvVarValues zero_values = { 0 }; | 103 EnvVarValues zero_values = { 0 }; |
104 values = zero_values; | 104 values = zero_values; |
105 } | 105 } |
106 | 106 |
107 // Begin base::Environment implementation. | 107 // Begin base::Environment implementation. |
108 virtual bool GetEnv(const char* variable_name, std::string* result) { | 108 virtual bool GetVar(const char* variable_name, std::string* result) { |
109 const char* env_value = table.Get(variable_name); | 109 const char* env_value = table.Get(variable_name); |
110 if (env_value) { | 110 if (env_value) { |
111 // Note that the variable may be defined but empty. | 111 // Note that the variable may be defined but empty. |
112 *result = env_value; | 112 *result = env_value; |
113 return true; | 113 return true; |
114 } | 114 } |
115 return false; | 115 return false; |
116 } | 116 } |
117 | 117 |
118 virtual bool SetVar(const char* variable_name, const std::string& new_value) { | 118 virtual bool SetVar(const char* variable_name, const std::string& new_value) { |
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1400 new ProxyConfigServiceLinux(env)); | 1400 new ProxyConfigServiceLinux(env)); |
1401 ProxyConfig config; | 1401 ProxyConfig config; |
1402 sync_config_getter.SetupAndInitialFetch(); | 1402 sync_config_getter.SetupAndInitialFetch(); |
1403 sync_config_getter.SyncGetLatestProxyConfig(&config); | 1403 sync_config_getter.SyncGetLatestProxyConfig(&config); |
1404 EXPECT_TRUE(config.auto_detect()); | 1404 EXPECT_TRUE(config.auto_detect()); |
1405 EXPECT_EQ(GURL(), config.pac_url()); | 1405 EXPECT_EQ(GURL(), config.pac_url()); |
1406 } | 1406 } |
1407 } | 1407 } |
1408 | 1408 |
1409 } // namespace net | 1409 } // namespace net |
OLD | NEW |