Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: net/proxy/proxy_config_service_linux_unittest.cc

Issue 2843048: base: Add SetEnv() to EnvVarGetter class and get rid of the some ifdefs. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: filename Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/logging_chrome_uitest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/common/logging_chrome_uitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698