webrtc_m130/pc/test/mock_rtp_sender_internal.h
Harald Alvestrand 6060df5948 Reland "Implement transceiver.stop()"
This is a reland of 11dc6571cb4ff3e71dee1557dfff8d9076e108d3

One fix that makes Web Platform Tests pass in debug mode is applied.

Original change's description:
> Implement transceiver.stop()
>
> This adds RtpTransceiver.StopStandard(), which behaves according to
> the specification at
> https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
>
> It modifies RTCPeerConnection.getTransceivers() to return only
> transceivers that have not been stopped.
>
> Rebase of armax' https://webrtc-review.googlesource.com/c/src/+/172762
>
> Bug: chromium:980879
> Change-Id: I7d383ee874ccc0a006fdcf280496b5d4235425ce
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/180580
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31893}

Bug: chromium:980879
Change-Id: Ide31d929ac5ea118d83fdf6a35a592af23f7dfa7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/181263
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Guido Urdaneta <guidou@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31907}
2020-08-11 10:46:23 +00:00

84 lines
3.0 KiB
C++

/*
* Copyright 2016 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 PC_TEST_MOCK_RTP_SENDER_INTERNAL_H_
#define PC_TEST_MOCK_RTP_SENDER_INTERNAL_H_
#include <string>
#include <vector>
#include "pc/rtp_sender.h"
#include "test/gmock.h"
namespace webrtc {
// The definition of MockRtpSender is copied in to avoid multiple inheritance.
class MockRtpSenderInternal : public RtpSenderInternal {
public:
// RtpSenderInterface methods.
MOCK_METHOD(bool, SetTrack, (MediaStreamTrackInterface*), (override));
MOCK_METHOD(rtc::scoped_refptr<MediaStreamTrackInterface>,
track,
(),
(const, override));
MOCK_METHOD(uint32_t, ssrc, (), (const, override));
MOCK_METHOD(rtc::scoped_refptr<DtlsTransportInterface>,
dtls_transport,
(),
(const, override));
MOCK_METHOD(cricket::MediaType, media_type, (), (const, override));
MOCK_METHOD(std::string, id, (), (const, override));
MOCK_METHOD(std::vector<std::string>, stream_ids, (), (const, override));
MOCK_METHOD(std::vector<RtpEncodingParameters>,
init_send_encodings,
(),
(const, override));
MOCK_METHOD(void,
set_transport,
(rtc::scoped_refptr<DtlsTransportInterface>),
(override));
MOCK_METHOD(RtpParameters, GetParameters, (), (const, override));
MOCK_METHOD(RtpParameters, GetParametersInternal, (), (const, override));
MOCK_METHOD(RTCError, SetParameters, (const RtpParameters&), (override));
MOCK_METHOD(RTCError,
SetParametersInternal,
(const RtpParameters&),
(override));
MOCK_METHOD(rtc::scoped_refptr<DtmfSenderInterface>,
GetDtmfSender,
(),
(const, override));
MOCK_METHOD(void,
SetFrameEncryptor,
(rtc::scoped_refptr<FrameEncryptorInterface>),
(override));
MOCK_METHOD(rtc::scoped_refptr<FrameEncryptorInterface>,
GetFrameEncryptor,
(),
(const, override));
// RtpSenderInternal methods.
MOCK_METHOD1(SetMediaChannel, void(cricket::MediaChannel*));
MOCK_METHOD1(SetSsrc, void(uint32_t));
MOCK_METHOD1(set_stream_ids, void(const std::vector<std::string>&));
MOCK_METHOD1(SetStreams, void(const std::vector<std::string>&));
MOCK_METHOD1(set_init_send_encodings,
void(const std::vector<RtpEncodingParameters>&));
MOCK_METHOD0(Stop, void());
MOCK_CONST_METHOD0(AttachmentId, int());
MOCK_METHOD1(DisableEncodingLayers,
RTCError(const std::vector<std::string>&));
MOCK_METHOD0(SetTransceiverAsStopped, void());
};
} // namespace webrtc
#endif // PC_TEST_MOCK_RTP_SENDER_INTERNAL_H_