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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 virtual bool GetEnv(const char* variable_name, std::string* result) { | 107 virtual bool GetEnv(const char* variable_name, std::string* result) { |
108 const char* env_value = table.Get(variable_name); | 108 const char* env_value = table.Get(variable_name); |
109 if (env_value) { | 109 if (env_value) { |
110 // Note that the variable may be defined but empty. | 110 // Note that the variable may be defined but empty. |
111 *result = env_value; | 111 *result = env_value; |
112 return true; | 112 return true; |
113 } | 113 } |
114 return false; | 114 return false; |
115 } | 115 } |
116 | 116 |
| 117 virtual void SetEnv(const char* variable_name, const std::string& new_value) { |
| 118 NOTIMPLEMENTED(); |
| 119 } |
117 // Intentionally public, for convenience when setting up a test. | 120 // Intentionally public, for convenience when setting up a test. |
118 EnvVarValues values; | 121 EnvVarValues values; |
119 | 122 |
120 private: | 123 private: |
121 SettingsTable<const char*> table; | 124 SettingsTable<const char*> table; |
122 }; | 125 }; |
123 | 126 |
124 class MockGConfSettingGetter | 127 class MockGConfSettingGetter |
125 : public ProxyConfigServiceLinux::GConfSettingGetter { | 128 : public ProxyConfigServiceLinux::GConfSettingGetter { |
126 public: | 129 public: |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 new ProxyConfigServiceLinux(env_getter)); | 1369 new ProxyConfigServiceLinux(env_getter)); |
1367 ProxyConfig config; | 1370 ProxyConfig config; |
1368 sync_config_getter.SetupAndInitialFetch(); | 1371 sync_config_getter.SetupAndInitialFetch(); |
1369 sync_config_getter.SyncGetProxyConfig(&config); | 1372 sync_config_getter.SyncGetProxyConfig(&config); |
1370 EXPECT_TRUE(config.auto_detect()); | 1373 EXPECT_TRUE(config.auto_detect()); |
1371 EXPECT_EQ(GURL(), config.pac_url()); | 1374 EXPECT_EQ(GURL(), config.pac_url()); |
1372 } | 1375 } |
1373 } | 1376 } |
1374 | 1377 |
1375 } // namespace net | 1378 } // namespace net |
OLD | NEW |