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

Side by Side Diff: chrome/browser/net/chrome_url_request_context_unittest.cc

Issue 4876002: Create additional PrefStore for Device Management policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review feedback Created 10 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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/policy/configuration_policy_pref_store.h" 9 #include "chrome/browser/policy/configuration_policy_pref_store.h"
10 #include "chrome/browser/prefs/command_line_pref_store.h" 10 #include "chrome/browser/prefs/command_line_pref_store.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 net::ProxyRulesExpectation::Empty(), 155 net::ProxyRulesExpectation::Empty(),
156 } 156 }
157 }; 157 };
158 158
159 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); i++) { 159 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); i++) {
160 SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i, 160 SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i,
161 tests[i].description.c_str())); 161 tests[i].description.c_str()));
162 CommandLine command_line(tests[i].command_line); 162 CommandLine command_line(tests[i].command_line);
163 // Only configuration-policy and default prefs are needed. 163 // Only configuration-policy and default prefs are needed.
164 PrefService prefs(new TestingPrefService::TestingPrefValueStore( 164 PrefService prefs(new TestingPrefService::TestingPrefValueStore(
165 new policy::ConfigurationPolicyPrefStore(NULL),
165 new policy::ConfigurationPolicyPrefStore(NULL), NULL, 166 new policy::ConfigurationPolicyPrefStore(NULL), NULL,
166 new CommandLinePrefStore(&command_line), NULL, NULL, 167 new CommandLinePrefStore(&command_line), NULL, NULL,
167 new DefaultPrefStore())); 168 new DefaultPrefStore()));
168 ChromeURLRequestContextGetter::RegisterUserPrefs(&prefs); 169 ChromeURLRequestContextGetter::RegisterUserPrefs(&prefs);
169 scoped_ptr<net::ProxyConfig> config(CreateProxyConfig(&prefs)); 170 scoped_ptr<net::ProxyConfig> config(CreateProxyConfig(&prefs));
170 171
171 if (tests[i].is_null) { 172 if (tests[i].is_null) {
172 EXPECT_TRUE(config == NULL); 173 EXPECT_TRUE(config == NULL);
173 } else { 174 } else {
174 EXPECT_TRUE(config != NULL); 175 EXPECT_TRUE(config != NULL);
175 EXPECT_EQ(tests[i].auto_detect, config->auto_detect()); 176 EXPECT_EQ(tests[i].auto_detect, config->auto_detect());
176 EXPECT_EQ(tests[i].pac_url, config->pac_url()); 177 EXPECT_EQ(tests[i].pac_url, config->pac_url());
177 EXPECT_TRUE(tests[i].proxy_rules.Matches(config->proxy_rules())); 178 EXPECT_TRUE(tests[i].proxy_rules.Matches(config->proxy_rules()));
178 } 179 }
179 } 180 }
180 } 181 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_pref_store_unittest.cc ('k') | chrome/browser/policy/configuration_policy_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698