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

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

Issue 816403003: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ssl_config_service_manager.h" 5 #include "chrome/browser/net/ssl_config_service_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 &version_min_str)); 165 &version_min_str));
166 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax, 166 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax,
167 &version_max_str)); 167 &version_max_str));
168 } 168 }
169 169
170 // Test that command-line settings for minimum and maximum SSL versions are 170 // Test that command-line settings for minimum and maximum SSL versions are
171 // respected and that they do not persist to the preferences files. 171 // respected and that they do not persist to the preferences files.
172 TEST_F(SSLConfigServiceManagerPrefTest, CommandLinePrefs) { 172 TEST_F(SSLConfigServiceManagerPrefTest, CommandLinePrefs) {
173 scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore()); 173 scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore());
174 174
175 CommandLine command_line(CommandLine::NO_PROGRAM); 175 base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
176 command_line.AppendSwitchASCII(switches::kSSLVersionMin, "tls1"); 176 command_line.AppendSwitchASCII(switches::kSSLVersionMin, "tls1");
177 command_line.AppendSwitchASCII(switches::kSSLVersionMax, "ssl3"); 177 command_line.AppendSwitchASCII(switches::kSSLVersionMax, "ssl3");
178 178
179 PrefServiceMockFactory factory; 179 PrefServiceMockFactory factory;
180 factory.set_user_prefs(local_state_store); 180 factory.set_user_prefs(local_state_store);
181 factory.SetCommandLine(&command_line); 181 factory.SetCommandLine(&command_line);
182 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple; 182 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple;
183 scoped_ptr<PrefService> local_state(factory.Create(registry.get())); 183 scoped_ptr<PrefService> local_state(factory.Create(registry.get()));
184 184
185 SSLConfigServiceManager::RegisterPrefs(registry.get()); 185 SSLConfigServiceManager::RegisterPrefs(registry.get());
(...skipping 19 matching lines...) Expand all
205 local_state->FindPreference(prefs::kSSLVersionMax); 205 local_state->FindPreference(prefs::kSSLVersionMax);
206 EXPECT_FALSE(version_max_pref->IsUserModifiable()); 206 EXPECT_FALSE(version_max_pref->IsUserModifiable());
207 207
208 std::string version_min_str; 208 std::string version_min_str;
209 std::string version_max_str; 209 std::string version_max_str;
210 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin, 210 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin,
211 &version_min_str)); 211 &version_min_str));
212 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax, 212 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax,
213 &version_max_str)); 213 &version_max_str));
214 } 214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698