From 0fc787ba93c8328917a373accc95e8501f4bf4bf Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Fri, 16 Jul 2021 17:36:52 +0200 Subject: [PATCH] api/test: Add Create() method to MockPeerConnectionInterface Bug: webrtc:9620 Change-Id: Id389e433cceed6435f6d07c1eae70c2d582c617f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226323 Commit-Queue: Florent Castelli Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34491} --- api/BUILD.gn | 2 ++ api/DEPS | 4 ++++ api/test/mock_peerconnectioninterface.h | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/api/BUILD.gn b/api/BUILD.gn index a5e7d91a6d..b80e500527 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -949,6 +949,8 @@ if (rtc_include_tests) { deps = [ ":libjingle_peerconnection_api", + "../api:scoped_refptr", + "../rtc_base:refcount", "../test:test_support", ] } diff --git a/api/DEPS b/api/DEPS index cdd17e9909..e912cd49f8 100644 --- a/api/DEPS +++ b/api/DEPS @@ -271,6 +271,10 @@ specific_include_rules = { "+test/gmock.h", ], + "mock_peerconnectioninterface\.h": [ + "+rtc_base/ref_counted_object.h", + ], + "simulated_network\.h": [ "+rtc_base/random.h", "+rtc_base/thread_annotations.h", diff --git a/api/test/mock_peerconnectioninterface.h b/api/test/mock_peerconnectioninterface.h index b5d94238c8..cd67d32a10 100644 --- a/api/test/mock_peerconnectioninterface.h +++ b/api/test/mock_peerconnectioninterface.h @@ -18,7 +18,9 @@ #include #include "api/peer_connection_interface.h" +#include "api/scoped_refptr.h" #include "api/sctp_transport_interface.h" +#include "rtc_base/ref_counted_object.h" #include "test/gmock.h" namespace webrtc { @@ -26,6 +28,10 @@ namespace webrtc { class MockPeerConnectionInterface : public rtc::RefCountedObject { public: + static rtc::scoped_refptr Create() { + return new MockPeerConnectionInterface(); + } + // PeerConnectionInterface MOCK_METHOD(rtc::scoped_refptr, local_streams,