tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 03859aa089df8c5891e706226c931db434a778e9
parent fe2575c2837d2d9e0cb81e5642db22f87b6167fb
Author: Michael Froman <mfroman@mozilla.com>
Date:   Thu,  9 Oct 2025 10:14:39 -0500

Bug 1993083 - Vendor libwebrtc from 0cbdcdf686

Upstream commit: https://webrtc.googlesource.com/src/+/0cbdcdf68697131a6ae27a5ea2c1b88c8d31cec8
    Fix and disable test for corruption header negotiation in integrationtest.

    The test currently fails and therefore is disabled. But the logic in
    test is updated such that it should pass when the bug in webrtc:383078466 has been fixed.

    Bug: webrtc:425336456
    Change-Id: Ie213bb4cd6e4991491a14f0ede5c7afa859fbe4d
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/399200
    Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
    Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Cr-Commit-Position: refs/heads/main@{#45129}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/pc/peer_connection_integrationtest.cc | 34+++++++++++-----------------------
Mthird_party/libwebrtc/pc/test/integration_test_helpers.h | 12++++++++++++
3 files changed, 25 insertions(+), 25 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 /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T15:13:26.110326+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T15:14:29.913011+00:00. # base of lastest vendoring -9689953749 +0cbdcdf686 diff --git a/third_party/libwebrtc/pc/peer_connection_integrationtest.cc b/third_party/libwebrtc/pc/peer_connection_integrationtest.cc @@ -4623,8 +4623,10 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, PeerConnectionInterface::kStable); } +// TODO: issues.webrtc.org/425336456 - figure out correct behavior and reenable. +// TODO: issues.webrtc.org/383078466 - should pass when this bug is fixed. TEST_F(PeerConnectionIntegrationTestUnifiedPlan, - OnlyOnePairWantsCorruptionScorePlumbing) { + DISABLED_OnlyOnePairWantsCorruptionScorePlumbingShouldFailToGetIt) { // In order for corruption score to be logged, encryption of RTP header // extensions must be allowed. CryptoOptions crypto_options; @@ -4636,23 +4638,23 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, ConnectFakeSignaling(); // Do normal offer/answer and wait for some frames to be received in each - // direction, and `corruption_score` to be aggregated. + // direction. caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); - // Negotiate the corruption detection header extension in SDP. - // If caller adds corruption detection header extension to its SDP offer, it - // will receive it from the callee. + + // Negotiate the corruption detection header extension in SDP only in one + // direction. caller()->NegotiateCorruptionDetectionHeader(); caller()->CreateAndSetAndSignalOffer(); ASSERT_THAT( WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), IsRtcOk()); - ASSERT_THAT(WaitUntil([&] { return caller()->GetCorruptionScoreCount(); }, - ::testing::Gt(0), {.timeout = kMaxWaitForStats}), + ASSERT_THAT(WaitUntil([&] { return caller()->GetReceivedFrameCount(); }, + ::testing::Eq(3), {.timeout = kMaxWaitForStats}), IsRtcOk()); - ASSERT_THAT(WaitUntil([&] { return callee()->GetCorruptionScoreCount(); }, - ::testing::Eq(0), {.timeout = kMaxWaitForStats}), + ASSERT_THAT(WaitUntil([&] { return callee()->GetReceivedFrameCount(); }, + ::testing::Eq(3), {.timeout = kMaxWaitForStats}), IsRtcOk()); for (const auto& pair : {caller(), callee()}) { @@ -4662,22 +4664,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, report->GetStatsOfType<RTCInboundRtpStreamStats>(); for (const auto& stat : inbound_stream_stats) { if (*stat->kind == "video") { - if (pair == caller()) { - EXPECT_TRUE(stat->total_corruption_probability.has_value()); - EXPECT_TRUE(stat->total_squared_corruption_probability.has_value()); - - double average_corruption_score = - (*stat->total_corruption_probability) / - static_cast<int32_t>(*stat->corruption_measurements); - EXPECT_GE(average_corruption_score, 0.0); - EXPECT_LE(average_corruption_score, 1.0); - } - if (pair == callee()) { - // Since only `caller` requests corruption score calculation the - // callee should not aggregate it. EXPECT_FALSE(stat->total_corruption_probability.has_value()); EXPECT_FALSE(stat->total_squared_corruption_probability.has_value()); - } } } } diff --git a/third_party/libwebrtc/pc/test/integration_test_helpers.h b/third_party/libwebrtc/pc/test/integration_test_helpers.h @@ -734,6 +734,18 @@ class PeerConnectionIntegrationWrapper : public PeerConnectionObserver, return 0; } + uint32_t GetReceivedFrameCount() { + scoped_refptr<const RTCStatsReport> report = NewGetStats(); + auto inbound_stream_stats = + report->GetStatsOfType<RTCInboundRtpStreamStats>(); + for (const auto& stat : inbound_stream_stats) { + if (*stat->kind == "video") { + return stat->frames_received.value_or(0); + } + } + return 0; + } + void set_connection_change_callback( std::function<void(PeerConnectionInterface::PeerConnectionState)> func) { connection_change_callback_ = std::move(func);