| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "net/base/ssl_config_service_win.h" | 5 #include "net/base/ssl_config_service_win.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 using base::TimeDelta; | 8 using base::TimeDelta; |
| 9 using base::TimeTicks; | 9 using base::TimeTicks; |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 class SSLConfigServiceWinTest : public testing::Test { | 33 class SSLConfigServiceWinTest : public testing::Test { |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 TEST(SSLConfigServiceWinTest, GetNowTest) { | 38 TEST(SSLConfigServiceWinTest, GetNowTest) { |
| 39 // Verify that the constructor sets the correct default values. | 39 // Verify that the constructor sets the correct default values. |
| 40 net::SSLConfig config; | 40 net::SSLConfig config; |
| 41 EXPECT_EQ(true, config.rev_checking_enabled); | 41 EXPECT_TRUE(config.rev_checking_enabled); |
| 42 EXPECT_EQ(true, config.ssl3_enabled); | 42 EXPECT_TRUE(config.ssl3_enabled); |
| 43 EXPECT_EQ(true, config.tls1_enabled); | 43 EXPECT_TRUE(config.tls1_enabled); |
| 44 | 44 |
| 45 bool rv = net::SSLConfigServiceWin::GetSSLConfigNow(&config); | 45 bool rv = net::SSLConfigServiceWin::GetSSLConfigNow(&config); |
| 46 EXPECT_TRUE(rv); | 46 EXPECT_TRUE(rv); |
| 47 } | 47 } |
| 48 | 48 |
| 49 TEST(SSLConfigServiceWinTest, SetTest) { | 49 TEST(SSLConfigServiceWinTest, SetTest) { |
| 50 // Save the current settings so we can restore them after the tests. | 50 // Save the current settings so we can restore them after the tests. |
| 51 net::SSLConfig config_save; | 51 net::SSLConfig config_save; |
| 52 bool rv = net::SSLConfigServiceWin::GetSSLConfigNow(&config_save); | 52 bool rv = net::SSLConfigServiceWin::GetSSLConfigNow(&config_save); |
| 53 EXPECT_TRUE(rv); | 53 EXPECT_TRUE(rv); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 // Verify that the observer was notified. | 145 // Verify that the observer was notified. |
| 146 EXPECT_TRUE(observer.change_was_observed()); | 146 EXPECT_TRUE(observer.change_was_observed()); |
| 147 | 147 |
| 148 // Remove the observer. | 148 // Remove the observer. |
| 149 config_service->RemoveObserver(&observer); | 149 config_service->RemoveObserver(&observer); |
| 150 | 150 |
| 151 // Restore the original SSL3 setting. | 151 // Restore the original SSL3 setting. |
| 152 net::SSLConfigServiceWin::SetSSL3Enabled(config_save.ssl3_enabled); | 152 net::SSLConfigServiceWin::SetSSL3Enabled(config_save.ssl3_enabled); |
| 153 } | 153 } |
| 154 | |
| OLD | NEW |