| 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/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" |
| 11 #include "base/prefs/testing_pref_store.h" | 11 #include "base/prefs/testing_pref_store.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 14 #include "chrome/browser/prefs/pref_service_mock_builder.h" | 14 #include "chrome/browser/prefs/pref_service_mock_builder.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/content_settings.h" | 16 #include "chrome/common/content_settings.h" |
| 17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/test/base/testing_pref_service_syncable.h" | 18 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 19 #include "chrome/test/base/testing_profile.h" | 19 #include "chrome/test/base/testing_profile.h" |
| 20 #include "content/public/test/test_browser_thread.h" | 20 #include "content/public/test/test_browser_thread.h" |
| 21 #include "net/ssl/ssl_config_service.h" | 21 #include "net/ssl/ssl_config_service.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 using base::ListValue; | 24 using base::ListValue; |
| 25 using base::Value; | 25 using base::Value; |
| 26 using content::BrowserThread; | 26 using content::BrowserThread; |
| 27 using net::SSLConfig; | 27 using net::SSLConfig; |
| 28 using net::SSLConfigService; | 28 using net::SSLConfigService; |
| 29 | 29 |
| 30 namespace { | |
| 31 | |
| 32 void SetCookiePref(TestingProfile* profile, ContentSetting setting) { | |
| 33 HostContentSettingsMap* host_content_settings_map = | |
| 34 profile->GetHostContentSettingsMap(); | |
| 35 host_content_settings_map->SetDefaultContentSetting( | |
| 36 CONTENT_SETTINGS_TYPE_COOKIES, setting); | |
| 37 } | |
| 38 | |
| 39 } // namespace | |
| 40 | |
| 41 class SSLConfigServiceManagerPrefTest : public testing::Test { | 30 class SSLConfigServiceManagerPrefTest : public testing::Test { |
| 42 public: | 31 public: |
| 43 SSLConfigServiceManagerPrefTest() | 32 SSLConfigServiceManagerPrefTest() |
| 44 : ui_thread_(BrowserThread::UI, &message_loop_), | 33 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 45 io_thread_(BrowserThread::IO, &message_loop_) {} | 34 io_thread_(BrowserThread::IO, &message_loop_) {} |
| 46 | 35 |
| 47 protected: | 36 protected: |
| 48 bool IsChannelIdEnabled(SSLConfigService* config_service) { | 37 bool IsChannelIdEnabled(SSLConfigService* config_service) { |
| 49 // Pump the message loop to notify the SSLConfigServiceManagerPref that the | 38 // Pump the message loop to notify the SSLConfigServiceManagerPref that the |
| 50 // preferences changed. | 39 // preferences changed. |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 std::string version_max_str; | 242 std::string version_max_str; |
| 254 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin, | 243 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin, |
| 255 &version_min_str)); | 244 &version_min_str)); |
| 256 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax, | 245 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax, |
| 257 &version_max_str)); | 246 &version_max_str)); |
| 258 bool unrestricted_ssl3_fallback_enabled; | 247 bool unrestricted_ssl3_fallback_enabled; |
| 259 EXPECT_FALSE(local_state_store->GetBoolean( | 248 EXPECT_FALSE(local_state_store->GetBoolean( |
| 260 prefs::kEnableUnrestrictedSSL3Fallback, | 249 prefs::kEnableUnrestrictedSSL3Fallback, |
| 261 &unrestricted_ssl3_fallback_enabled)); | 250 &unrestricted_ssl3_fallback_enabled)); |
| 262 } | 251 } |
| OLD | NEW |