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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 288 |
289 // Using a pref service without any preference set should result in | 289 // Using a pref service without any preference set should result in |
290 // SHA-1 local trust anchors being disabled. | 290 // SHA-1 local trust anchors being disabled. |
291 SSLConfig config2; | 291 SSLConfig config2; |
292 config_service->GetSSLConfig(&config2); | 292 config_service->GetSSLConfig(&config2); |
293 EXPECT_FALSE(config2.sha1_local_anchors_enabled); | 293 EXPECT_FALSE(config2.sha1_local_anchors_enabled); |
294 | 294 |
295 // Enabling the local preference should result in SHA-1 local trust anchors | 295 // Enabling the local preference should result in SHA-1 local trust anchors |
296 // being enabled. | 296 // being enabled. |
297 local_state.SetUserPref(ssl_config::prefs::kCertEnableSha1LocalAnchors, | 297 local_state.SetUserPref(ssl_config::prefs::kCertEnableSha1LocalAnchors, |
298 new base::FundamentalValue(true)); | 298 new base::Value(true)); |
299 // Pump the message loop to notify the SSLConfigServiceManagerPref that the | 299 // Pump the message loop to notify the SSLConfigServiceManagerPref that the |
300 // preferences changed. | 300 // preferences changed. |
301 base::RunLoop().RunUntilIdle(); | 301 base::RunLoop().RunUntilIdle(); |
302 | 302 |
303 SSLConfig config3; | 303 SSLConfig config3; |
304 config_service->GetSSLConfig(&config3); | 304 config_service->GetSSLConfig(&config3); |
305 EXPECT_TRUE(config3.sha1_local_anchors_enabled); | 305 EXPECT_TRUE(config3.sha1_local_anchors_enabled); |
306 | 306 |
307 // Disabling the local preference should result in SHA-1 local trust | 307 // Disabling the local preference should result in SHA-1 local trust |
308 // anchors being disabled. | 308 // anchors being disabled. |
309 local_state.SetUserPref(ssl_config::prefs::kCertEnableSha1LocalAnchors, | 309 local_state.SetUserPref(ssl_config::prefs::kCertEnableSha1LocalAnchors, |
310 new base::FundamentalValue(false)); | 310 new base::Value(false)); |
311 // Pump the message loop to notify the SSLConfigServiceManagerPref that the | 311 // Pump the message loop to notify the SSLConfigServiceManagerPref that the |
312 // preferences changed. | 312 // preferences changed. |
313 base::RunLoop().RunUntilIdle(); | 313 base::RunLoop().RunUntilIdle(); |
314 | 314 |
315 SSLConfig config4; | 315 SSLConfig config4; |
316 config_service->GetSSLConfig(&config4); | 316 config_service->GetSSLConfig(&config4); |
317 EXPECT_FALSE(config4.sha1_local_anchors_enabled); | 317 EXPECT_FALSE(config4.sha1_local_anchors_enabled); |
318 } | 318 } |
OLD | NEW |