OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/protocol/channel_socket_adapter.h" | 5 #include "remoting/protocol/channel_socket_adapter.h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 int flags)); | 42 int flags)); |
43 MOCK_METHOD2(SetOption, int(rtc::Socket::Option opt, int value)); | 43 MOCK_METHOD2(SetOption, int(rtc::Socket::Option opt, int value)); |
44 MOCK_METHOD0(GetError, int()); | 44 MOCK_METHOD0(GetError, int()); |
45 MOCK_CONST_METHOD0(GetIceRole, cricket::IceRole()); | 45 MOCK_CONST_METHOD0(GetIceRole, cricket::IceRole()); |
46 MOCK_METHOD1(GetStats, bool(cricket::ConnectionInfos* infos)); | 46 MOCK_METHOD1(GetStats, bool(cricket::ConnectionInfos* infos)); |
47 MOCK_CONST_METHOD0(IsDtlsActive, bool()); | 47 MOCK_CONST_METHOD0(IsDtlsActive, bool()); |
48 MOCK_CONST_METHOD1(GetSslRole, bool(rtc::SSLRole* role)); | 48 MOCK_CONST_METHOD1(GetSslRole, bool(rtc::SSLRole* role)); |
49 MOCK_METHOD1(SetSrtpCiphers, bool(const std::vector<std::string>& ciphers)); | 49 MOCK_METHOD1(SetSrtpCiphers, bool(const std::vector<std::string>& ciphers)); |
50 MOCK_METHOD1(GetSrtpCipher, bool(std::string* cipher)); | 50 MOCK_METHOD1(GetSrtpCipher, bool(std::string* cipher)); |
51 MOCK_METHOD1(GetSslCipher, bool(std::string* cipher)); | 51 MOCK_METHOD1(GetSslCipher, bool(std::string* cipher)); |
52 MOCK_CONST_METHOD1(GetLocalIdentity, bool(rtc::SSLIdentity** identity)); | 52 MOCK_CONST_METHOD0(GetLocalCertificate, |
53 MOCK_CONST_METHOD1(GetRemoteCertificate, | 53 rtc::scoped_refptr<rtc::RTCCertificate>()); |
| 54 MOCK_CONST_METHOD1(GetRemoteSSLCertificate, |
54 bool(rtc::SSLCertificate** cert)); | 55 bool(rtc::SSLCertificate** cert)); |
55 MOCK_METHOD6(ExportKeyingMaterial, bool(const std::string& label, | 56 MOCK_METHOD6(ExportKeyingMaterial, bool(const std::string& label, |
56 const uint8* context, | 57 const uint8* context, |
57 size_t context_len, | 58 size_t context_len, |
58 bool use_context, | 59 bool use_context, |
59 uint8* result, | 60 uint8* result, |
60 size_t result_len)); | 61 size_t result_len)); |
61 }; | 62 }; |
62 | 63 |
63 class TransportChannelSocketAdapterTest : public testing::Test { | 64 class TransportChannelSocketAdapterTest : public testing::Test { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 133 |
133 EXPECT_CALL(channel_, GetError()) | 134 EXPECT_CALL(channel_, GetError()) |
134 .WillOnce(Return(EWOULDBLOCK)); | 135 .WillOnce(Return(EWOULDBLOCK)); |
135 | 136 |
136 int result = target_->Send(buffer.get(), kTestDataSize, callback_); | 137 int result = target_->Send(buffer.get(), kTestDataSize, callback_); |
137 ASSERT_EQ(net::OK, result); | 138 ASSERT_EQ(net::OK, result); |
138 } | 139 } |
139 | 140 |
140 } // namespace protocol | 141 } // namespace protocol |
141 } // namespace remoting | 142 } // namespace remoting |
OLD | NEW |