OLD | NEW |
---|---|
(Empty) | |
1 /* | |
Taylor Brandstetter
2017/01/10 17:49:13
I'm guessing you need to rebase, since this was ad
| |
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 IceTransportInternal { | |
29 public: | |
30 MockIceTransport() { | |
31 SignalReadyToSend(this); | |
32 SignalWritableState(this); | |
33 } | |
34 | |
35 MOCK_METHOD4(SendPacket, | |
36 int(const char* data, | |
37 size_t len, | |
38 const rtc::PacketOptions& options, | |
39 int flags)); | |
40 MOCK_METHOD2(SetOption, int(rtc::Socket::Option opt, int value)); | |
41 MOCK_METHOD0(GetError, int()); | |
42 MOCK_CONST_METHOD0(GetIceRole, cricket::IceRole()); | |
43 MOCK_METHOD1(GetStats, bool(cricket::ConnectionInfos* infos)); | |
44 MOCK_CONST_METHOD0(IsDtlsActive, bool()); | |
45 MOCK_CONST_METHOD1(GetSslRole, bool(rtc::SSLRole* role)); | |
46 | |
47 IceTransportState GetState() const override { | |
48 return IceTransportState::STATE_INIT; | |
49 } | |
50 const std::string& transport_name() const override { return transport_name_; } | |
51 int component() const override { return 0; } | |
52 void SetIceRole(IceRole role) override {} | |
53 void SetIceTiebreaker(uint64_t tiebreaker) override {} | |
54 // The ufrag and pwd in |ice_params| must be set | |
55 // before candidate gathering can start. | |
56 void SetIceParameters(const IceParameters& ice_params) override {} | |
57 void SetRemoteIceParameters(const IceParameters& ice_params) override {} | |
58 void SetRemoteIceMode(IceMode mode) override {} | |
59 void SetIceConfig(const IceConfig& config) override {} | |
60 void MaybeStartGathering() override {} | |
61 void SetMetricsObserver(webrtc::MetricsObserverInterface* observer) override { | |
62 } | |
63 void AddRemoteCandidate(const Candidate& candidate) override {} | |
64 void RemoveRemoteCandidate(const Candidate& candidate) override {} | |
65 IceGatheringState gathering_state() const override { | |
66 return IceGatheringState::kIceGatheringComplete; | |
67 } | |
68 | |
69 bool receiving() const override { return true; } | |
70 bool writable() const override { return true; } | |
71 | |
72 private: | |
73 std::string transport_name_; | |
74 }; | |
75 | |
76 } // namespace cricket | |
77 | |
78 #endif // WEBRTC_P2P_BASE_MOCKICETRANSPORT_H_ | |
OLD | NEW |