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

Side by Side Diff: components/ssl_config/ssl_config_service_manager_pref_unittest.cc

Issue 2030833003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
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/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 &local_state, base::ThreadTaskRunnerHandle::Get())); 58 &local_state, base::ThreadTaskRunnerHandle::Get()));
59 ASSERT_TRUE(config_manager.get()); 59 ASSERT_TRUE(config_manager.get());
60 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); 60 scoped_refptr<SSLConfigService> config_service(config_manager->Get());
61 ASSERT_TRUE(config_service.get()); 61 ASSERT_TRUE(config_service.get());
62 62
63 SSLConfig old_config; 63 SSLConfig old_config;
64 config_service->GetSSLConfig(&old_config); 64 config_service->GetSSLConfig(&old_config);
65 EXPECT_TRUE(old_config.disabled_cipher_suites.empty()); 65 EXPECT_TRUE(old_config.disabled_cipher_suites.empty());
66 66
67 base::ListValue* list_value = new base::ListValue(); 67 base::ListValue* list_value = new base::ListValue();
68 list_value->Append(new base::StringValue("0x0004")); 68 list_value->AppendString("0x0004");
69 list_value->Append(new base::StringValue("0x0005")); 69 list_value->AppendString("0x0005");
70 local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist, list_value); 70 local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist, list_value);
71 71
72 // Pump the message loop to notify the SSLConfigServiceManagerPref that the 72 // Pump the message loop to notify the SSLConfigServiceManagerPref that the
73 // preferences changed. 73 // preferences changed.
74 message_loop_.RunUntilIdle(); 74 message_loop_.RunUntilIdle();
75 75
76 SSLConfig config; 76 SSLConfig config;
77 config_service->GetSSLConfig(&config); 77 config_service->GetSSLConfig(&config);
78 78
79 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites); 79 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites);
(...skipping 14 matching lines...) Expand all
94 &local_state, base::ThreadTaskRunnerHandle::Get())); 94 &local_state, base::ThreadTaskRunnerHandle::Get()));
95 ASSERT_TRUE(config_manager.get()); 95 ASSERT_TRUE(config_manager.get());
96 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); 96 scoped_refptr<SSLConfigService> config_service(config_manager->Get());
97 ASSERT_TRUE(config_service.get()); 97 ASSERT_TRUE(config_service.get());
98 98
99 SSLConfig old_config; 99 SSLConfig old_config;
100 config_service->GetSSLConfig(&old_config); 100 config_service->GetSSLConfig(&old_config);
101 EXPECT_TRUE(old_config.disabled_cipher_suites.empty()); 101 EXPECT_TRUE(old_config.disabled_cipher_suites.empty());
102 102
103 base::ListValue* list_value = new base::ListValue(); 103 base::ListValue* list_value = new base::ListValue();
104 list_value->Append(new base::StringValue("0x0004")); 104 list_value->AppendString("0x0004");
105 list_value->Append(new base::StringValue("TLS_NOT_WITH_A_CIPHER_SUITE")); 105 list_value->AppendString("TLS_NOT_WITH_A_CIPHER_SUITE");
106 list_value->Append(new base::StringValue("0x0005")); 106 list_value->AppendString("0x0005");
107 list_value->Append(new base::StringValue("0xBEEFY")); 107 list_value->AppendString("0xBEEFY");
108 local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist, list_value); 108 local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist, list_value);
109 109
110 // Pump the message loop to notify the SSLConfigServiceManagerPref that the 110 // Pump the message loop to notify the SSLConfigServiceManagerPref that the
111 // preferences changed. 111 // preferences changed.
112 message_loop_.RunUntilIdle(); 112 message_loop_.RunUntilIdle();
113 113
114 SSLConfig config; 114 SSLConfig config;
115 config_service->GetSSLConfig(&config); 115 config_service->GetSSLConfig(&config);
116 116
117 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites); 117 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 &local_state, base::ThreadTaskRunnerHandle::Get())); 190 &local_state, base::ThreadTaskRunnerHandle::Get()));
191 ASSERT_TRUE(config_manager.get()); 191 ASSERT_TRUE(config_manager.get());
192 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); 192 scoped_refptr<SSLConfigService> config_service(config_manager->Get());
193 ASSERT_TRUE(config_service.get()); 193 ASSERT_TRUE(config_service.get());
194 194
195 SSLConfig ssl_config; 195 SSLConfig ssl_config;
196 config_service->GetSSLConfig(&ssl_config); 196 config_service->GetSSLConfig(&ssl_config);
197 // The command-line option must not have been honored. 197 // The command-line option must not have been honored.
198 EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1_2, ssl_config.version_fallback_min); 198 EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1_2, ssl_config.version_fallback_min);
199 } 199 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698