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/browser/configuration_policy_pref_store.h" | 9 #include "chrome/browser/configuration_policy_pref_store.h" |
10 #include "chrome/browser/pref_value_store.h" | 10 #include "chrome/browser/pref_value_store.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 GURL(), // pac_url | 152 GURL(), // pac_url |
153 net::ProxyRulesExpectation::Empty(), | 153 net::ProxyRulesExpectation::Empty(), |
154 } | 154 } |
155 }; | 155 }; |
156 | 156 |
157 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); i++) { | 157 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); i++) { |
158 SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i, | 158 SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i, |
159 tests[i].description.c_str())); | 159 tests[i].description.c_str())); |
160 CommandLine command_line(tests[i].command_line); | 160 CommandLine command_line(tests[i].command_line); |
161 PrefService prefs(new PrefValueStore( | 161 PrefService prefs(new PrefValueStore( |
162 new ConfigurationPolicyPrefStore(&command_line, NULL), NULL, NULL)); | 162 new ConfigurationPolicyPrefStore(&command_line, NULL), |
| 163 NULL, NULL, NULL)); // No extension, user, or recommended prefs. |
163 ChromeURLRequestContextGetter::RegisterUserPrefs(&prefs); | 164 ChromeURLRequestContextGetter::RegisterUserPrefs(&prefs); |
164 scoped_ptr<net::ProxyConfig> config(CreateProxyConfig(&prefs)); | 165 scoped_ptr<net::ProxyConfig> config(CreateProxyConfig(&prefs)); |
165 | 166 |
166 if (tests[i].is_null) { | 167 if (tests[i].is_null) { |
167 EXPECT_TRUE(config == NULL); | 168 EXPECT_TRUE(config == NULL); |
168 } else { | 169 } else { |
169 EXPECT_TRUE(config != NULL); | 170 EXPECT_TRUE(config != NULL); |
170 EXPECT_EQ(tests[i].auto_detect, config->auto_detect()); | 171 EXPECT_EQ(tests[i].auto_detect, config->auto_detect()); |
171 EXPECT_EQ(tests[i].pac_url, config->pac_url()); | 172 EXPECT_EQ(tests[i].pac_url, config->pac_url()); |
172 EXPECT_TRUE(tests[i].proxy_rules.Matches(config->proxy_rules())); | 173 EXPECT_TRUE(tests[i].proxy_rules.Matches(config->proxy_rules())); |
173 } | 174 } |
174 } | 175 } |
175 } | 176 } |
176 | 177 |
OLD | NEW |