OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/pref_proxy_config_service.h" | 5 #include "chrome/browser/net/pref_proxy_config_service.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/net/ssl_config_service_manager.h" | 9 #include "chrome/browser/net/ssl_config_service_manager.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 SSLConfigServiceManager::CreateDefaultManager(pref_service_.get())); | 53 SSLConfigServiceManager::CreateDefaultManager(pref_service_.get())); |
54 ASSERT_TRUE(config_manager.get()); | 54 ASSERT_TRUE(config_manager.get()); |
55 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); | 55 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); |
56 ASSERT_TRUE(config_service.get()); | 56 ASSERT_TRUE(config_service.get()); |
57 | 57 |
58 SSLConfig old_config; | 58 SSLConfig old_config; |
59 config_service->GetSSLConfig(&old_config); | 59 config_service->GetSSLConfig(&old_config); |
60 EXPECT_TRUE(old_config.disabled_cipher_suites.empty()); | 60 EXPECT_TRUE(old_config.disabled_cipher_suites.empty()); |
61 | 61 |
62 ListValue* list_value = new ListValue(); | 62 ListValue* list_value = new ListValue(); |
63 list_value->Append(Value::CreateStringValue("0x0004")); | 63 list_value->Append(base::StringValue::New("0x0004")); |
64 list_value->Append(Value::CreateStringValue("0x0005")); | 64 list_value->Append(base::StringValue::New("0x0005")); |
65 pref_service_->SetUserPref(prefs::kCipherSuiteBlacklist, list_value); | 65 pref_service_->SetUserPref(prefs::kCipherSuiteBlacklist, list_value); |
66 | 66 |
67 // Pump the message loop to notify the SSLConfigServiceManagerPref that the | 67 // Pump the message loop to notify the SSLConfigServiceManagerPref that the |
68 // preferences changed. | 68 // preferences changed. |
69 message_loop_->RunAllPending(); | 69 message_loop_->RunAllPending(); |
70 | 70 |
71 SSLConfig config; | 71 SSLConfig config; |
72 config_service->GetSSLConfig(&config); | 72 config_service->GetSSLConfig(&config); |
73 | 73 |
74 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites); | 74 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites); |
(...skipping 10 matching lines...) Expand all Loading... |
85 SSLConfigServiceManager::CreateDefaultManager(pref_service_.get())); | 85 SSLConfigServiceManager::CreateDefaultManager(pref_service_.get())); |
86 ASSERT_TRUE(config_manager.get()); | 86 ASSERT_TRUE(config_manager.get()); |
87 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); | 87 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); |
88 ASSERT_TRUE(config_service.get()); | 88 ASSERT_TRUE(config_service.get()); |
89 | 89 |
90 SSLConfig old_config; | 90 SSLConfig old_config; |
91 config_service->GetSSLConfig(&old_config); | 91 config_service->GetSSLConfig(&old_config); |
92 EXPECT_TRUE(old_config.disabled_cipher_suites.empty()); | 92 EXPECT_TRUE(old_config.disabled_cipher_suites.empty()); |
93 | 93 |
94 ListValue* list_value = new ListValue(); | 94 ListValue* list_value = new ListValue(); |
95 list_value->Append(Value::CreateStringValue("0x0004")); | 95 list_value->Append(base::StringValue::New("0x0004")); |
96 list_value->Append(Value::CreateStringValue("TLS_NOT_WITH_A_CIPHER_SUITE")); | 96 list_value->Append(base::StringValue::New("TLS_NOT_WITH_A_CIPHER_SUITE")); |
97 list_value->Append(Value::CreateStringValue("0x0005")); | 97 list_value->Append(base::StringValue::New("0x0005")); |
98 list_value->Append(Value::CreateStringValue("0xBEEFY")); | 98 list_value->Append(base::StringValue::New("0xBEEFY")); |
99 pref_service_->SetUserPref(prefs::kCipherSuiteBlacklist, list_value); | 99 pref_service_->SetUserPref(prefs::kCipherSuiteBlacklist, list_value); |
100 | 100 |
101 // Pump the message loop to notify the SSLConfigServiceManagerPref that the | 101 // Pump the message loop to notify the SSLConfigServiceManagerPref that the |
102 // preferences changed. | 102 // preferences changed. |
103 message_loop_->RunAllPending(); | 103 message_loop_->RunAllPending(); |
104 | 104 |
105 SSLConfig config; | 105 SSLConfig config; |
106 config_service->GetSSLConfig(&config); | 106 config_service->GetSSLConfig(&config); |
107 | 107 |
108 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites); | 108 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites); |
109 ASSERT_EQ(2u, config.disabled_cipher_suites.size()); | 109 ASSERT_EQ(2u, config.disabled_cipher_suites.size()); |
110 EXPECT_EQ(0x0004, config.disabled_cipher_suites[0]); | 110 EXPECT_EQ(0x0004, config.disabled_cipher_suites[0]); |
111 EXPECT_EQ(0x0005, config.disabled_cipher_suites[1]); | 111 EXPECT_EQ(0x0005, config.disabled_cipher_suites[1]); |
112 } | 112 } |
OLD | NEW |