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

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

Issue 2082333002: Remove calls to deprecated MessageLoop methods 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/run_loop.h"
10 #include "base/threading/thread_task_runner_handle.h" 11 #include "base/threading/thread_task_runner_handle.h"
11 #include "base/values.h" 12 #include "base/values.h"
12 #include "components/prefs/testing_pref_service.h" 13 #include "components/prefs/testing_pref_service.h"
13 #include "components/ssl_config/ssl_config_prefs.h" 14 #include "components/ssl_config/ssl_config_prefs.h"
14 #include "components/ssl_config/ssl_config_service_manager.h" 15 #include "components/ssl_config/ssl_config_service_manager.h"
15 #include "components/ssl_config/ssl_config_switches.h" 16 #include "components/ssl_config/ssl_config_switches.h"
16 #include "net/ssl/ssl_config.h" 17 #include "net/ssl/ssl_config.h"
17 #include "net/ssl/ssl_config_service.h" 18 #include "net/ssl/ssl_config_service.h"
18 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
19 20
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 config_service->GetSSLConfig(&old_config); 65 config_service->GetSSLConfig(&old_config);
65 EXPECT_TRUE(old_config.disabled_cipher_suites.empty()); 66 EXPECT_TRUE(old_config.disabled_cipher_suites.empty());
66 67
67 base::ListValue* list_value = new base::ListValue(); 68 base::ListValue* list_value = new base::ListValue();
68 list_value->AppendString("0x0004"); 69 list_value->AppendString("0x0004");
69 list_value->AppendString("0x0005"); 70 list_value->AppendString("0x0005");
70 local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist, list_value); 71 local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist, list_value);
71 72
72 // Pump the message loop to notify the SSLConfigServiceManagerPref that the 73 // Pump the message loop to notify the SSLConfigServiceManagerPref that the
73 // preferences changed. 74 // preferences changed.
74 message_loop_.RunUntilIdle(); 75 base::RunLoop().RunUntilIdle();
75 76
76 SSLConfig config; 77 SSLConfig config;
77 config_service->GetSSLConfig(&config); 78 config_service->GetSSLConfig(&config);
78 79
79 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites); 80 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites);
80 ASSERT_EQ(2u, config.disabled_cipher_suites.size()); 81 ASSERT_EQ(2u, config.disabled_cipher_suites.size());
81 EXPECT_EQ(0x0004, config.disabled_cipher_suites[0]); 82 EXPECT_EQ(0x0004, config.disabled_cipher_suites[0]);
82 EXPECT_EQ(0x0005, config.disabled_cipher_suites[1]); 83 EXPECT_EQ(0x0005, config.disabled_cipher_suites[1]);
83 } 84 }
84 85
(...skipping 17 matching lines...) Expand all
102 103
103 base::ListValue* list_value = new base::ListValue(); 104 base::ListValue* list_value = new base::ListValue();
104 list_value->AppendString("0x0004"); 105 list_value->AppendString("0x0004");
105 list_value->AppendString("TLS_NOT_WITH_A_CIPHER_SUITE"); 106 list_value->AppendString("TLS_NOT_WITH_A_CIPHER_SUITE");
106 list_value->AppendString("0x0005"); 107 list_value->AppendString("0x0005");
107 list_value->AppendString("0xBEEFY"); 108 list_value->AppendString("0xBEEFY");
108 local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist, list_value); 109 local_state.SetUserPref(ssl_config::prefs::kCipherSuiteBlacklist, list_value);
109 110
110 // Pump the message loop to notify the SSLConfigServiceManagerPref that the 111 // Pump the message loop to notify the SSLConfigServiceManagerPref that the
111 // preferences changed. 112 // preferences changed.
112 message_loop_.RunUntilIdle(); 113 base::RunLoop().RunUntilIdle();
113 114
114 SSLConfig config; 115 SSLConfig config;
115 config_service->GetSSLConfig(&config); 116 config_service->GetSSLConfig(&config);
116 117
117 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites); 118 EXPECT_NE(old_config.disabled_cipher_suites, config.disabled_cipher_suites);
118 ASSERT_EQ(2u, config.disabled_cipher_suites.size()); 119 ASSERT_EQ(2u, config.disabled_cipher_suites.size());
119 EXPECT_EQ(0x0004, config.disabled_cipher_suites[0]); 120 EXPECT_EQ(0x0004, config.disabled_cipher_suites[0]);
120 EXPECT_EQ(0x0005, config.disabled_cipher_suites[1]); 121 EXPECT_EQ(0x0005, config.disabled_cipher_suites[1]);
121 } 122 }
122 123
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 &local_state, base::ThreadTaskRunnerHandle::Get())); 191 &local_state, base::ThreadTaskRunnerHandle::Get()));
191 ASSERT_TRUE(config_manager.get()); 192 ASSERT_TRUE(config_manager.get());
192 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); 193 scoped_refptr<SSLConfigService> config_service(config_manager->Get());
193 ASSERT_TRUE(config_service.get()); 194 ASSERT_TRUE(config_service.get());
194 195
195 SSLConfig ssl_config; 196 SSLConfig ssl_config;
196 config_service->GetSSLConfig(&ssl_config); 197 config_service->GetSSLConfig(&ssl_config);
197 // The command-line option must not have been honored. 198 // The command-line option must not have been honored.
198 EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1_2, ssl_config.version_fallback_min); 199 EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1_2, ssl_config.version_fallback_min);
199 } 200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698