Update MockPeerConnectionInterface and fake with missing methods.

Goal is to make PeerConnectionInterface methods pure virtual.
This is a split of cl https://webrtc-review.googlesource.com/c/src/+/340143 in order to be able to fix Chromium test RTCPeerConnectionHandlerTest.OnRenegotiationNeeded


Bug: none
Change-Id: I5eac4d9a96c1b594c9e2b3505ef2466046065dc8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340481
Auto-Submit: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41798}
This commit is contained in:
Per K 2024-02-23 17:08:41 +01:00 committed by WebRTC LUCI CQ
parent 3f0d399c07
commit 3fe69c504c
3 changed files with 21 additions and 0 deletions

View File

@ -160,6 +160,10 @@ class MockPeerConnectionInterface : public webrtc::PeerConnectionInterface {
(std::unique_ptr<SessionDescriptionInterface>,
rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>),
(override));
MOCK_METHOD(bool,
ShouldFireNegotiationNeededEvent,
(uint32_t event_id),
(override));
MOCK_METHOD(PeerConnectionInterface::RTCConfiguration,
GetConfiguration,
(),
@ -195,6 +199,10 @@ class MockPeerConnectionInterface : public webrtc::PeerConnectionInterface {
(override));
MOCK_METHOD(PeerConnectionState, peer_connection_state, (), (override));
MOCK_METHOD(IceGatheringState, ice_gathering_state, (), (override));
MOCK_METHOD(void,
AddAdaptationResource,
(rtc::scoped_refptr<Resource>),
(override));
MOCK_METHOD(absl::optional<bool>, can_trickle_ice_candidates, (), (override));
MOCK_METHOD(bool,
StartRtcEventLog,
@ -206,6 +214,7 @@ class MockPeerConnectionInterface : public webrtc::PeerConnectionInterface {
(override));
MOCK_METHOD(void, StopRtcEventLog, (), (override));
MOCK_METHOD(void, Close, (), (override));
MOCK_METHOD(rtc::Thread*, signaling_thread, (), (const override));
};
static_assert(

View File

@ -177,6 +177,8 @@ class FakePeerConnectionBase : public PeerConnectionInternal {
rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer)
override {}
bool ShouldFireNegotiationNeededEvent(uint32_t event_id) { return true; }
RTCConfiguration GetConfiguration() override { return RTCConfiguration(); }
RTCError SetConfiguration(
@ -229,6 +231,8 @@ class FakePeerConnectionBase : public PeerConnectionInternal {
absl::optional<bool> can_trickle_ice_candidates() { return absl::nullopt; }
void AddAdaptationResource(rtc::scoped_refptr<Resource> resource) {}
bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) override {
return false;

View File

@ -153,6 +153,10 @@ class MockPeerConnectionInternal : public PeerConnectionInternal {
(std::unique_ptr<SessionDescriptionInterface>,
rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>),
(override));
MOCK_METHOD(bool,
ShouldFireNegotiationNeededEvent,
(uint32_t event_id),
(override));
MOCK_METHOD(PeerConnectionInterface::RTCConfiguration,
GetConfiguration,
(),
@ -192,6 +196,10 @@ class MockPeerConnectionInternal : public PeerConnectionInternal {
(override));
MOCK_METHOD(PeerConnectionState, peer_connection_state, (), (override));
MOCK_METHOD(IceGatheringState, ice_gathering_state, (), (override));
MOCK_METHOD(void,
AddAdaptationResource,
(rtc::scoped_refptr<Resource>),
(override));
MOCK_METHOD(absl::optional<bool>, can_trickle_ice_candidates, (), (override));
MOCK_METHOD(bool,
StartRtcEventLog,