Per Kjellander | 52f7ae7 | 2019-09-10 17:28:06 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019 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 API_TRANSPORT_TEST_MOCK_NETWORK_CONTROL_H_ |
| 12 | #define API_TRANSPORT_TEST_MOCK_NETWORK_CONTROL_H_ |
| 13 | |
| 14 | #include "api/transport/network_control.h" |
| 15 | #include "test/gmock.h" |
| 16 | |
| 17 | namespace webrtc { |
| 18 | |
Per K | 452d940 | 2023-03-22 15:31:23 | [diff] [blame] | 19 | class MockNetworkControllerInterface : public NetworkControllerInterface { |
| 20 | public: |
| 21 | MOCK_METHOD(NetworkControlUpdate, |
| 22 | OnNetworkAvailability, |
| 23 | (NetworkAvailability), |
| 24 | (override)); |
| 25 | MOCK_METHOD(NetworkControlUpdate, |
| 26 | OnProcessInterval, |
| 27 | (ProcessInterval), |
| 28 | (override)); |
| 29 | MOCK_METHOD(NetworkControlUpdate, |
| 30 | OnNetworkRouteChange, |
| 31 | (NetworkRouteChange), |
| 32 | (override)); |
| 33 | MOCK_METHOD(NetworkControlUpdate, |
| 34 | OnRemoteBitrateReport, |
| 35 | (RemoteBitrateReport), |
| 36 | (override)); |
| 37 | MOCK_METHOD(NetworkControlUpdate, |
| 38 | OnRoundTripTimeUpdate, |
| 39 | (RoundTripTimeUpdate), |
| 40 | (override)); |
| 41 | MOCK_METHOD(NetworkControlUpdate, OnSentPacket, (SentPacket), (override)); |
| 42 | MOCK_METHOD(NetworkControlUpdate, |
| 43 | OnReceivedPacket, |
| 44 | (ReceivedPacket), |
| 45 | (override)); |
| 46 | MOCK_METHOD(NetworkControlUpdate, |
| 47 | OnStreamsConfig, |
| 48 | (StreamsConfig), |
| 49 | (override)); |
| 50 | MOCK_METHOD(NetworkControlUpdate, |
| 51 | OnTargetRateConstraints, |
| 52 | (TargetRateConstraints), |
| 53 | (override)); |
| 54 | MOCK_METHOD(NetworkControlUpdate, |
| 55 | OnTransportLossReport, |
| 56 | (TransportLossReport), |
| 57 | (override)); |
| 58 | MOCK_METHOD(NetworkControlUpdate, |
| 59 | OnTransportPacketsFeedback, |
| 60 | (TransportPacketsFeedback), |
| 61 | (override)); |
| 62 | MOCK_METHOD(NetworkControlUpdate, |
| 63 | OnNetworkStateEstimate, |
| 64 | (NetworkStateEstimate), |
| 65 | (override)); |
| 66 | }; |
| 67 | |
Per Kjellander | 52f7ae7 | 2019-09-10 17:28:06 | [diff] [blame] | 68 | class MockNetworkStateEstimator : public NetworkStateEstimator { |
| 69 | public: |
Danil Chapovalov | 42748d8 | 2020-05-14 18:42:41 | [diff] [blame] | 70 | MOCK_METHOD(absl::optional<NetworkStateEstimate>, |
| 71 | GetCurrentEstimate, |
| 72 | (), |
| 73 | (override)); |
| 74 | MOCK_METHOD(void, |
| 75 | OnTransportPacketsFeedback, |
| 76 | (const TransportPacketsFeedback&), |
| 77 | (override)); |
| 78 | MOCK_METHOD(void, OnReceivedPacket, (const PacketResult&), (override)); |
| 79 | MOCK_METHOD(void, OnRouteChange, (const NetworkRouteChange&), (override)); |
Per Kjellander | 52f7ae7 | 2019-09-10 17:28:06 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | } // namespace webrtc |
| 83 | |
| 84 | #endif // API_TRANSPORT_TEST_MOCK_NETWORK_CONTROL_H_ |