commit f9c3e9762292e951e2f7559ea05688eb893cf5fe
parent 6bd6a31518c34446f9918a470c510bea314a42de
Author: Dan Baker <dbaker@mozilla.com>
Date: Mon, 27 Oct 2025 17:27:17 -0600
Bug 1995393 - Vendor libwebrtc from 2f553bf8d5
Upstream commit: https://webrtc.googlesource.com/src/+/2f553bf8d573c90176d51559b76dfc836996c8f5
Add a default constructor for MockIceController
One-parameter constructor doesn't use the paramater, and thus tests
shouldn't be burden to construct it.
Requiring tests to construct unused IceControllerFactoryArgs complicates
extending that struct like was attempted in
https://webrtc-review.googlesource.com/c/src/+/407100
Bug: webrtc:42223992
Change-Id: I1d19972331e6d4b1ba3c7f671493126ca4573e50
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407047
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45520}
Diffstat:
3 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor
@@ -1,4 +1,4 @@
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
-libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T23:25:10.707105+00:00.
+libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-27T23:27:05.491205+00:00.
# base of lastest vendoring
-a5e91cc1e9
+2f553bf8d5
diff --git a/third_party/libwebrtc/p2p/base/wrapping_active_ice_controller_unittest.cc b/third_party/libwebrtc/p2p/base/wrapping_active_ice_controller_unittest.cc
@@ -82,8 +82,7 @@ TEST(WrappingActiveIceControllerTest, CreateLegacyIceControllerFromFactory) {
TEST(WrappingActiveIceControllerTest, PassthroughIceControllerInterface) {
AutoThread main;
MockIceAgent agent;
- std::unique_ptr<MockIceController> will_move =
- std::make_unique<MockIceController>(IceControllerFactoryArgs{});
+ auto will_move = std::make_unique<MockIceController>();
MockIceController* wrapped = will_move.get();
WrappingActiveIceController controller(&agent, std::move(will_move));
@@ -119,8 +118,7 @@ TEST(WrappingActiveIceControllerTest, HandlesImmediateSwitchRequest) {
AutoThread main;
ScopedFakeClock clock;
NiceMock<MockIceAgent> agent;
- std::unique_ptr<NiceMockIceController> will_move =
- std::make_unique<NiceMockIceController>(IceControllerFactoryArgs{});
+ auto will_move = std::make_unique<NiceMockIceController>();
NiceMockIceController* wrapped = will_move.get();
WrappingActiveIceController controller(&agent, std::move(will_move));
@@ -164,8 +162,7 @@ TEST(WrappingActiveIceControllerTest, HandlesImmediateSortAndSwitchRequest) {
AutoThread main;
ScopedFakeClock clock;
NiceMock<MockIceAgent> agent;
- std::unique_ptr<NiceMockIceController> will_move =
- std::make_unique<NiceMockIceController>(IceControllerFactoryArgs{});
+ auto will_move = std::make_unique<NiceMockIceController>();
NiceMockIceController* wrapped = will_move.get();
WrappingActiveIceController controller(&agent, std::move(will_move));
@@ -222,8 +219,7 @@ TEST(WrappingActiveIceControllerTest, HandlesSortAndSwitchRequest) {
main.PostTask([&init, &init_delay] { init.Wait(init_delay); });
NiceMock<MockIceAgent> agent;
- std::unique_ptr<NiceMockIceController> will_move =
- std::make_unique<NiceMockIceController>(IceControllerFactoryArgs{});
+ auto will_move = std::make_unique<NiceMockIceController>();
NiceMockIceController* wrapped = will_move.get();
WrappingActiveIceController controller(&agent, std::move(will_move));
@@ -267,8 +263,7 @@ TEST(WrappingActiveIceControllerTest, StartPingingAfterSortAndSwitch) {
main.PostTask([&init, &init_delay] { init.Wait(init_delay); });
NiceMock<MockIceAgent> agent;
- std::unique_ptr<NiceMockIceController> will_move =
- std::make_unique<NiceMockIceController>(IceControllerFactoryArgs{});
+ auto will_move = std::make_unique<NiceMockIceController>();
NiceMockIceController* wrapped = will_move.get();
WrappingActiveIceController controller(&agent, std::move(will_move));
diff --git a/third_party/libwebrtc/p2p/test/mock_ice_controller.h b/third_party/libwebrtc/p2p/test/mock_ice_controller.h
@@ -28,6 +28,7 @@ namespace webrtc {
class MockIceController : public IceControllerInterface {
public:
+ MockIceController() = default;
explicit MockIceController(const IceControllerFactoryArgs& /* args */) {}
~MockIceController() override = default;
@@ -41,21 +42,18 @@ class MockIceController : public IceControllerInterface {
(const, override));
MOCK_METHOD(ArrayView<const Connection*>, connections, (), (const, override));
MOCK_METHOD(bool, HasPingableConnection, (), (const, override));
- MOCK_METHOD(IceControllerInterface::PingResult,
- SelectConnectionToPing,
- (int64_t),
- (override));
+ MOCK_METHOD(PingResult, SelectConnectionToPing, (int64_t), (override));
MOCK_METHOD(bool,
GetUseCandidateAttr,
(const Connection*, NominationMode, IceMode),
(const, override));
MOCK_METHOD(const Connection*, FindNextPingableConnection, (), (override));
MOCK_METHOD(void, MarkConnectionPinged, (const Connection*), (override));
- MOCK_METHOD(IceControllerInterface::SwitchResult,
+ MOCK_METHOD(SwitchResult,
ShouldSwitchConnection,
(IceSwitchReason, const Connection*),
(override));
- MOCK_METHOD(IceControllerInterface::SwitchResult,
+ MOCK_METHOD(SwitchResult,
SortAndSwitchConnection,
(IceSwitchReason),
(override));
@@ -67,9 +65,9 @@ class MockIceControllerFactory : public IceControllerFactoryInterface {
~MockIceControllerFactory() override = default;
std::unique_ptr<IceControllerInterface> Create(
- const IceControllerFactoryArgs& args) override {
+ const IceControllerFactoryArgs& /*args*/) override {
RecordIceControllerCreated();
- return std::make_unique<MockIceController>(args);
+ return std::make_unique<MockIceController>();
}
MOCK_METHOD(void, RecordIceControllerCreated, ());