OLD | NEW |
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.h" | 9 #include "base/message_loop.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 protected: | 47 protected: |
48 bool IsChannelIdEnabled(SSLConfigService* config_service) { | 48 bool IsChannelIdEnabled(SSLConfigService* config_service) { |
49 // Pump the message loop to notify the SSLConfigServiceManagerPref that the | 49 // Pump the message loop to notify the SSLConfigServiceManagerPref that the |
50 // preferences changed. | 50 // preferences changed. |
51 message_loop_.RunUntilIdle(); | 51 message_loop_.RunUntilIdle(); |
52 SSLConfig config; | 52 SSLConfig config; |
53 config_service->GetSSLConfig(&config); | 53 config_service->GetSSLConfig(&config); |
54 return config.channel_id_enabled; | 54 return config.channel_id_enabled; |
55 } | 55 } |
56 | 56 |
57 MessageLoop message_loop_; | 57 base::MessageLoop message_loop_; |
58 content::TestBrowserThread ui_thread_; | 58 content::TestBrowserThread ui_thread_; |
59 content::TestBrowserThread io_thread_; | 59 content::TestBrowserThread io_thread_; |
60 }; | 60 }; |
61 | 61 |
62 // Test channel id with no user prefs. | 62 // Test channel id with no user prefs. |
63 TEST_F(SSLConfigServiceManagerPrefTest, ChannelIDWithoutUserPrefs) { | 63 TEST_F(SSLConfigServiceManagerPrefTest, ChannelIDWithoutUserPrefs) { |
64 TestingPrefServiceSimple local_state; | 64 TestingPrefServiceSimple local_state; |
65 SSLConfigServiceManager::RegisterPrefs(local_state.registry()); | 65 SSLConfigServiceManager::RegisterPrefs(local_state.registry()); |
66 local_state.SetUserPref(prefs::kEnableOriginBoundCerts, | 66 local_state.SetUserPref(prefs::kEnableOriginBoundCerts, |
67 Value::CreateBooleanValue(false)); | 67 Value::CreateBooleanValue(false)); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 std::string version_max_str; | 317 std::string version_max_str; |
318 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin, | 318 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin, |
319 &version_min_str)); | 319 &version_min_str)); |
320 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax, | 320 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax, |
321 &version_max_str)); | 321 &version_max_str)); |
322 bool unrestricted_ssl3_fallback_enabled; | 322 bool unrestricted_ssl3_fallback_enabled; |
323 EXPECT_FALSE(local_state_store->GetBoolean( | 323 EXPECT_FALSE(local_state_store->GetBoolean( |
324 prefs::kEnableUnrestrictedSSL3Fallback, | 324 prefs::kEnableUnrestrictedSSL3Fallback, |
325 &unrestricted_ssl3_fallback_enabled)); | 325 &unrestricted_ssl3_fallback_enabled)); |
326 } | 326 } |
OLD | NEW |