OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 "chrome/browser/net/chrome_url_request_context.h" | 5 #include "chrome/browser/net/chrome_url_request_context.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 #include "net/proxy/proxy_config.h" | 10 #include "net/proxy/proxy_config.h" |
11 #include "net/proxy/proxy_config_service_common_unittest.h" | 11 #include "net/proxy/proxy_config_service_common_unittest.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 // Builds an identifier for each test in an array. | 14 // Builds an identifier for each test in an array. |
15 #define TEST_DESC(desc) StringPrintf("at line %d <%s>", __LINE__, desc) | 15 #define TEST_DESC(desc) StringPrintf("at line %d <%s>", __LINE__, desc) |
16 | 16 |
17 TEST(ChromeUrlRequestContextTest, CreateProxyConfigTest) { | 17 TEST(ChromeURLRequestContextTest, CreateProxyConfigTest) { |
18 FilePath unused_path(FILE_PATH_LITERAL("foo.exe")); | 18 FilePath unused_path(FILE_PATH_LITERAL("foo.exe")); |
19 // Build the input command lines here. | 19 // Build the input command lines here. |
20 CommandLine empty(unused_path); | 20 CommandLine empty(unused_path); |
21 CommandLine no_proxy(unused_path); | 21 CommandLine no_proxy(unused_path); |
22 no_proxy.AppendSwitch(switches::kNoProxyServer); | 22 no_proxy.AppendSwitch(switches::kNoProxyServer); |
23 CommandLine no_proxy_extra_params(unused_path); | 23 CommandLine no_proxy_extra_params(unused_path); |
24 no_proxy_extra_params.AppendSwitch(switches::kNoProxyServer); | 24 no_proxy_extra_params.AppendSwitch(switches::kNoProxyServer); |
25 no_proxy_extra_params.AppendSwitchWithValue(switches::kProxyServer, | 25 no_proxy_extra_params.AppendSwitchWithValue(switches::kProxyServer, |
26 L"http://proxy:8888"); | 26 L"http://proxy:8888"); |
27 CommandLine single_proxy(unused_path); | 27 CommandLine single_proxy(unused_path); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (tests[i].is_null) { | 161 if (tests[i].is_null) { |
162 EXPECT_TRUE(config == NULL); | 162 EXPECT_TRUE(config == NULL); |
163 } else { | 163 } else { |
164 EXPECT_TRUE(config != NULL); | 164 EXPECT_TRUE(config != NULL); |
165 EXPECT_EQ(tests[i].auto_detect, config->auto_detect()); | 165 EXPECT_EQ(tests[i].auto_detect, config->auto_detect()); |
166 EXPECT_EQ(tests[i].pac_url, config->pac_url()); | 166 EXPECT_EQ(tests[i].pac_url, config->pac_url()); |
167 EXPECT_TRUE(tests[i].proxy_rules.Matches(config->proxy_rules())); | 167 EXPECT_TRUE(tests[i].proxy_rules.Matches(config->proxy_rules())); |
168 } | 168 } |
169 } | 169 } |
170 } | 170 } |
OLD | NEW |