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

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

Issue 155792: Try again: Add proxy config (using gnome-network-preferences) (Closed)
Patch Set: nits fixed Created 11 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "net/proxy/proxy_config_service_linux.h" 9 #include "net/proxy/proxy_config_service_linux.h"
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 typename map_type::const_iterator it = settings.find(key); 67 typename map_type::const_iterator it = settings.find(key);
68 // In case there's a typo or the unittest becomes out of sync. 68 // In case there's a typo or the unittest becomes out of sync.
69 CHECK(it != settings.end()) << "key " << key << " not found"; 69 CHECK(it != settings.end()) << "key " << key << " not found";
70 value_type* value_ptr = it->second; 70 value_type* value_ptr = it->second;
71 return *value_ptr; 71 return *value_ptr;
72 } 72 }
73 73
74 map_type settings; 74 map_type settings;
75 }; 75 };
76 76
77 class MockEnvironmentVariableGetter 77 class MockEnvironmentVariableGetter : public base::EnvironmentVariableGetter {
78 : public ProxyConfigServiceLinux::EnvironmentVariableGetter {
79 public: 78 public:
80 MockEnvironmentVariableGetter() { 79 MockEnvironmentVariableGetter() {
81 #define ENTRY(x) table.settings[#x] = &values.x 80 #define ENTRY(x) table.settings[#x] = &values.x
82 ENTRY(GNOME_DESKTOP_SESSION_ID); 81 ENTRY(GNOME_DESKTOP_SESSION_ID);
83 ENTRY(DESKTOP_SESSION); 82 ENTRY(DESKTOP_SESSION);
84 ENTRY(auto_proxy); 83 ENTRY(auto_proxy);
85 ENTRY(all_proxy); 84 ENTRY(all_proxy);
86 ENTRY(http_proxy); 85 ENTRY(http_proxy);
87 ENTRY(https_proxy); 86 ENTRY(https_proxy);
88 ENTRY(ftp_proxy); 87 ENTRY(ftp_proxy);
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 879
881 // Now set to auto-detect. 880 // Now set to auto-detect.
882 gconf_getter->values.mode = "auto"; 881 gconf_getter->values.mode = "auto";
883 // Simulate gconf notification callback. 882 // Simulate gconf notification callback.
884 service.OnCheckProxyConfigSettings(); 883 service.OnCheckProxyConfigSettings();
885 sync_config_getter.SyncGetProxyConfig(&config); 884 sync_config_getter.SyncGetProxyConfig(&config);
886 EXPECT_TRUE(config.auto_detect); 885 EXPECT_TRUE(config.auto_detect);
887 } 886 }
888 887
889 } // namespace net 888 } // namespace net
OLDNEW
« net/proxy/proxy_config_service_linux.cc ('K') | « net/proxy/proxy_config_service_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698