OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ |
| 10 |
| 11 #ifndef WEBRTC_P2P_BASE_MOCKICETRANSPORT_H_ |
| 12 #define WEBRTC_P2P_BASE_MOCKICETRANSPORT_H_ |
| 13 |
| 14 #include <memory> |
| 15 #include <string> |
| 16 #include <vector> |
| 17 |
| 18 #include "webrtc/base/gunit.h" |
| 19 #include "webrtc/p2p/base/icetransportinternal.h" |
| 20 #include "webrtc/test/gmock.h" |
| 21 |
| 22 using testing::_; |
| 23 using testing::Return; |
| 24 |
| 25 namespace cricket { |
| 26 |
| 27 // Used in Chromium/remoting/protocol/channel_socket_adapter_unittest.cc |
| 28 class MockIceTransport : public cricket::TransportChannel { |
| 29 public: |
| 30 MockIceTransport() : cricket::TransportChannel(std::string(), 0) { |
| 31 set_writable(true); |
| 32 } |
| 33 |
| 34 MOCK_METHOD4(SendPacket, |
| 35 int(const char* data, |
| 36 size_t len, |
| 37 const rtc::PacketOptions& options, |
| 38 int flags)); |
| 39 MOCK_METHOD2(SetOption, int(rtc::Socket::Option opt, int value)); |
| 40 MOCK_METHOD0(GetError, int()); |
| 41 MOCK_CONST_METHOD0(GetIceRole, cricket::IceRole()); |
| 42 MOCK_METHOD1(GetStats, bool(cricket::ConnectionInfos* infos)); |
| 43 MOCK_CONST_METHOD0(IsDtlsActive, bool()); |
| 44 MOCK_CONST_METHOD1(GetSslRole, bool(rtc::SSLRole* role)); |
| 45 MOCK_METHOD1(SetSrtpCiphers, bool(const std::vector<std::string>& ciphers)); |
| 46 MOCK_METHOD1(GetSrtpCipher, bool(std::string* cipher)); |
| 47 MOCK_METHOD1(GetSslCipher, bool(std::string* cipher)); |
| 48 MOCK_CONST_METHOD0(GetLocalCertificate, |
| 49 rtc::scoped_refptr<rtc::RTCCertificate>()); |
| 50 |
| 51 // This can't be a real mock method because gmock doesn't support move-only |
| 52 // return values. |
| 53 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate() |
| 54 const override { |
| 55 EXPECT_TRUE(false); // Never called. |
| 56 return nullptr; |
| 57 } |
| 58 |
| 59 MOCK_METHOD6(ExportKeyingMaterial, |
| 60 bool(const std::string& label, |
| 61 const uint8_t* context, |
| 62 size_t context_len, |
| 63 bool use_context, |
| 64 uint8_t* result, |
| 65 size_t result_len)); |
| 66 }; |
| 67 |
| 68 } // namespace cricket |
| 69 |
| 70 #endif // WEBRTC_P2P_BASE_MOCKICETRANSPORT_H_ |
OLD | NEW |