OLD | NEW |
---|---|
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 "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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1185 false, // bypass_local_names | 1185 false, // bypass_local_names |
1186 }, | 1186 }, |
1187 }; | 1187 }; |
1188 | 1188 |
1189 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 1189 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { |
1190 SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i, | 1190 SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i, |
1191 tests[i].description.c_str())); | 1191 tests[i].description.c_str())); |
1192 MockEnvironmentVariableGetter* env_getter = | 1192 MockEnvironmentVariableGetter* env_getter = |
1193 new MockEnvironmentVariableGetter; | 1193 new MockEnvironmentVariableGetter; |
1194 // Force the KDE getter to be used and tell it where the test is. | 1194 // Force the KDE getter to be used and tell it where the test is. |
1195 env_getter->values.DESKTOP_SESSION = "kde"; | 1195 env_getter->values.DESKTOP_SESSION = "kde4"; |
Evan Martin
2009/11/21 18:31:58
Is it really never the case that DESKTOP_SESSION=k
| |
1196 env_getter->values.KDE_HOME = kde_home_.value().c_str(); | 1196 env_getter->values.KDE_HOME = kde_home_.value().c_str(); |
1197 SynchConfigGetter sync_config_getter( | 1197 SynchConfigGetter sync_config_getter( |
1198 new ProxyConfigServiceLinux(env_getter)); | 1198 new ProxyConfigServiceLinux(env_getter)); |
1199 ProxyConfig config; | 1199 ProxyConfig config; |
1200 // Overwrite the kioslaverc file. | 1200 // Overwrite the kioslaverc file. |
1201 file_util::WriteFile(kioslaverc_, tests[i].kioslaverc.c_str(), | 1201 file_util::WriteFile(kioslaverc_, tests[i].kioslaverc.c_str(), |
1202 tests[i].kioslaverc.length()); | 1202 tests[i].kioslaverc.length()); |
1203 sync_config_getter.SetupAndInitialFetch(); | 1203 sync_config_getter.SetupAndInitialFetch(); |
1204 sync_config_getter.SyncGetProxyConfig(&config); | 1204 sync_config_getter.SyncGetProxyConfig(&config); |
1205 | 1205 |
1206 EXPECT_EQ(tests[i].auto_detect, config.auto_detect); | 1206 EXPECT_EQ(tests[i].auto_detect, config.auto_detect); |
1207 EXPECT_EQ(tests[i].pac_url, config.pac_url); | 1207 EXPECT_EQ(tests[i].pac_url, config.pac_url); |
1208 EXPECT_EQ(tests[i].proxy_bypass_list, | 1208 EXPECT_EQ(tests[i].proxy_bypass_list, |
1209 FlattenProxyBypass(config.proxy_bypass)); | 1209 FlattenProxyBypass(config.proxy_bypass)); |
1210 EXPECT_EQ(tests[i].bypass_local_names, config.proxy_bypass_local_names); | 1210 EXPECT_EQ(tests[i].bypass_local_names, config.proxy_bypass_local_names); |
1211 EXPECT_EQ(tests[i].proxy_rules, config.proxy_rules); | 1211 EXPECT_EQ(tests[i].proxy_rules, config.proxy_rules); |
1212 } | 1212 } |
1213 } | 1213 } |
1214 | 1214 |
1215 } // namespace net | 1215 } // namespace net |
OLD | NEW |