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 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ | 5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ |
6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ | 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 int64_t GetTotalReceivedBytes() const override; | 576 int64_t GetTotalReceivedBytes() const override; |
577 | 577 |
578 // SSLClientSocket implementation. | 578 // SSLClientSocket implementation. |
579 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override; | 579 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override; |
580 int ExportKeyingMaterial(const base::StringPiece& label, | 580 int ExportKeyingMaterial(const base::StringPiece& label, |
581 bool has_context, | 581 bool has_context, |
582 const base::StringPiece& context, | 582 const base::StringPiece& context, |
583 unsigned char* out, | 583 unsigned char* out, |
584 unsigned int outlen) override; | 584 unsigned int outlen) override; |
585 ChannelIDService* GetChannelIDService() const override; | 585 ChannelIDService* GetChannelIDService() const override; |
586 Error GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, | 586 Error GetTokenBindingSignature(crypto::ECPrivateKey* key, |
587 std::vector<uint8_t>* out) override; | 587 TokenBindingType tb_type, |
| 588 std::vector<uint8_t>* out) override; |
588 crypto::ECPrivateKey* GetChannelIDKey() const override; | 589 crypto::ECPrivateKey* GetChannelIDKey() const override; |
589 | 590 |
590 protected: | 591 protected: |
591 ~MockClientSocket() override; | 592 ~MockClientSocket() override; |
592 void RunCallbackAsync(const CompletionCallback& callback, int result); | 593 void RunCallbackAsync(const CompletionCallback& callback, int result); |
593 void RunCallback(const CompletionCallback& callback, int result); | 594 void RunCallback(const CompletionCallback& callback, int result); |
594 | 595 |
595 // True if Connect completed successfully and Disconnect hasn't been called. | 596 // True if Connect completed successfully and Disconnect hasn't been called. |
596 bool connected_; | 597 bool connected_; |
597 | 598 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 bool IsConnected() const override; | 693 bool IsConnected() const override; |
693 bool IsConnectedAndIdle() const override; | 694 bool IsConnectedAndIdle() const override; |
694 bool WasEverUsed() const override; | 695 bool WasEverUsed() const override; |
695 int GetPeerAddress(IPEndPoint* address) const override; | 696 int GetPeerAddress(IPEndPoint* address) const override; |
696 bool WasNpnNegotiated() const override; | 697 bool WasNpnNegotiated() const override; |
697 NextProto GetNegotiatedProtocol() const override; | 698 NextProto GetNegotiatedProtocol() const override; |
698 bool GetSSLInfo(SSLInfo* ssl_info) override; | 699 bool GetSSLInfo(SSLInfo* ssl_info) override; |
699 | 700 |
700 // SSLClientSocket implementation. | 701 // SSLClientSocket implementation. |
701 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override; | 702 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override; |
702 Error GetSignedEKMForTokenBinding(crypto::ECPrivateKey* key, | 703 Error GetTokenBindingSignature(crypto::ECPrivateKey* key, |
703 std::vector<uint8_t>* out) override; | 704 TokenBindingType tb_type, |
| 705 std::vector<uint8_t>* out) override; |
704 // This MockSocket does not implement the manual async IO feature. | 706 // This MockSocket does not implement the manual async IO feature. |
705 void OnReadComplete(const MockRead& data) override; | 707 void OnReadComplete(const MockRead& data) override; |
706 void OnWriteComplete(int rv) override; | 708 void OnWriteComplete(int rv) override; |
707 void OnConnectComplete(const MockConnect& data) override; | 709 void OnConnectComplete(const MockConnect& data) override; |
708 // SSL sockets don't need magic to deal with destruction of their data | 710 // SSL sockets don't need magic to deal with destruction of their data |
709 // provider. | 711 // provider. |
710 // TODO(mmenke): Probably a good idea to support it, anyways. | 712 // TODO(mmenke): Probably a good idea to support it, anyways. |
711 void OnDataProviderDestroyed() override {} | 713 void OnDataProviderDestroyed() override {} |
712 | 714 |
713 ChannelIDService* GetChannelIDService() const override; | 715 ChannelIDService* GetChannelIDService() const override; |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 | 1008 |
1007 // Helper function to get the total data size of the MockReads in |reads|. | 1009 // Helper function to get the total data size of the MockReads in |reads|. |
1008 int64_t CountReadBytes(const MockRead reads[], size_t reads_size); | 1010 int64_t CountReadBytes(const MockRead reads[], size_t reads_size); |
1009 | 1011 |
1010 // Helper function to get the total data size of the MockWrites in |writes|. | 1012 // Helper function to get the total data size of the MockWrites in |writes|. |
1011 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size); | 1013 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size); |
1012 | 1014 |
1013 } // namespace net | 1015 } // namespace net |
1014 | 1016 |
1015 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 1017 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
OLD | NEW |