Bug: webrtc:370878648 Change-Id: I4529c17f54c653864cca27097e44c843210b9c52 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/368061 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Dor Hen <dorhen@meta.com> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43429}
63 lines
2.1 KiB
C++
63 lines
2.1 KiB
C++
/*
|
|
* Copyright (c) 2021 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
#ifndef NET_DCSCTP_TX_MOCK_SEND_QUEUE_H_
|
|
#define NET_DCSCTP_TX_MOCK_SEND_QUEUE_H_
|
|
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <vector>
|
|
|
|
#include "api/array_view.h"
|
|
#include "api/units/timestamp.h"
|
|
#include "net/dcsctp/tx/send_queue.h"
|
|
#include "test/gmock.h"
|
|
|
|
namespace dcsctp {
|
|
|
|
class MockSendQueue : public SendQueue {
|
|
public:
|
|
MockSendQueue() {
|
|
ON_CALL(*this, Produce)
|
|
.WillByDefault([](webrtc::Timestamp /* now */, size_t /* max_size */) {
|
|
return std::nullopt;
|
|
});
|
|
}
|
|
|
|
MOCK_METHOD(std::optional<SendQueue::DataToSend>,
|
|
Produce,
|
|
(webrtc::Timestamp now, size_t max_size),
|
|
(override));
|
|
MOCK_METHOD(bool,
|
|
Discard,
|
|
(StreamID stream_id, OutgoingMessageId message_id),
|
|
(override));
|
|
MOCK_METHOD(void, PrepareResetStream, (StreamID stream_id), (override));
|
|
MOCK_METHOD(bool, HasStreamsReadyToBeReset, (), (const, override));
|
|
MOCK_METHOD(std::vector<StreamID>, GetStreamsReadyToBeReset, (), (override));
|
|
MOCK_METHOD(void, CommitResetStreams, (), (override));
|
|
MOCK_METHOD(void, RollbackResetStreams, (), (override));
|
|
MOCK_METHOD(void, Reset, (), (override));
|
|
MOCK_METHOD(size_t, buffered_amount, (StreamID stream_id), (const, override));
|
|
MOCK_METHOD(size_t, total_buffered_amount, (), (const, override));
|
|
MOCK_METHOD(size_t,
|
|
buffered_amount_low_threshold,
|
|
(StreamID stream_id),
|
|
(const, override));
|
|
MOCK_METHOD(void,
|
|
SetBufferedAmountLowThreshold,
|
|
(StreamID stream_id, size_t bytes),
|
|
(override));
|
|
MOCK_METHOD(void, EnableMessageInterleaving, (bool enabled), (override));
|
|
};
|
|
|
|
} // namespace dcsctp
|
|
|
|
#endif // NET_DCSCTP_TX_MOCK_SEND_QUEUE_H_
|