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 "net/socket/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 | 676 |
677 // A mock CTVerifier that records every call to Verify but doesn't verify | 677 // A mock CTVerifier that records every call to Verify but doesn't verify |
678 // anything. | 678 // anything. |
679 class MockCTVerifier : public CTVerifier { | 679 class MockCTVerifier : public CTVerifier { |
680 public: | 680 public: |
681 MOCK_METHOD5(Verify, int(X509Certificate*, | 681 MOCK_METHOD5(Verify, int(X509Certificate*, |
682 const std::string&, | 682 const std::string&, |
683 const std::string&, | 683 const std::string&, |
684 ct::CTVerifyResult*, | 684 ct::CTVerifyResult*, |
685 const BoundNetLog&)); | 685 const BoundNetLog&)); |
| 686 MOCK_METHOD0(StopNotifications, void()); |
| 687 MOCK_METHOD1(SetObserver, void(CTVerifier::Observer*)); |
686 }; | 688 }; |
687 | 689 |
688 class SSLClientSocketTest : public PlatformTest { | 690 class SSLClientSocketTest : public PlatformTest { |
689 public: | 691 public: |
690 SSLClientSocketTest() | 692 SSLClientSocketTest() |
691 : socket_factory_(ClientSocketFactory::GetDefaultFactory()), | 693 : socket_factory_(ClientSocketFactory::GetDefaultFactory()), |
692 cert_verifier_(new MockCertVerifier), | 694 cert_verifier_(new MockCertVerifier), |
693 transport_security_state_(new TransportSecurityState) { | 695 transport_security_state_(new TransportSecurityState) { |
694 cert_verifier_->set_default_result(OK); | 696 cert_verifier_->set_default_result(OK); |
695 context_.cert_verifier = cert_verifier_.get(); | 697 context_.cert_verifier = cert_verifier_.get(); |
(...skipping 2756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3452 ssl_config.channel_id_enabled = true; | 3454 ssl_config.channel_id_enabled = true; |
3453 | 3455 |
3454 int rv; | 3456 int rv; |
3455 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); | 3457 ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv)); |
3456 | 3458 |
3457 EXPECT_EQ(ERR_UNEXPECTED, rv); | 3459 EXPECT_EQ(ERR_UNEXPECTED, rv); |
3458 EXPECT_FALSE(sock_->IsConnected()); | 3460 EXPECT_FALSE(sock_->IsConnected()); |
3459 } | 3461 } |
3460 | 3462 |
3461 } // namespace net | 3463 } // namespace net |
OLD | NEW |