tor-browser

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

commit 9ea6681e142d4c7fab473fd02e6893b2ee057239
parent e9912b83d0ab03c5bb861dff3a395449e7e0d976
Author: Michael Froman <mfroman@mozilla.com>
Date:   Thu,  9 Oct 2025 14:44:24 -0500

Bug 1993083 - Vendor libwebrtc from aceb93ed87

Upstream commit: https://webrtc.googlesource.com/src/+/aceb93ed872750ed1af838e4c10c361d94c11959
    [Cleanup] Drop ::testing:: prefix.

    Bug: None
    Change-Id: Id6f3cad4830304516757a4ca4124490c5692495d
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/400501
    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@{#45156}

Diffstat:
Mthird_party/libwebrtc/README.mozilla.last-vendor | 4++--
Mthird_party/libwebrtc/pc/peer_connection_integrationtest.cc | 984+++++++++++++++++++++++++++++++++----------------------------------------------
Mthird_party/libwebrtc/pc/peer_connection_interface_unittest.cc | 97+++++++++++++++++++++++++++++++++++--------------------------------------------
3 files changed, 453 insertions(+), 632 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-09T19:43:11.766878+00:00. +libwebrtc updated from /home/mfroman/mozilla/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-09T19:44:17.229232+00:00. # base of lastest vendoring -79f6537c65 +aceb93ed87 diff --git a/third_party/libwebrtc/pc/peer_connection_integrationtest.cc b/third_party/libwebrtc/pc/peer_connection_integrationtest.cc @@ -106,15 +106,18 @@ namespace { using ::testing::AtLeast; using ::testing::Eq; using ::testing::Field; +using ::testing::Gt; using ::testing::InSequence; +using ::testing::Invoke; +using ::testing::IsTrue; using ::testing::MockFunction; using ::testing::NiceMock; using ::testing::NotNull; using ::testing::Return; +using ::testing::WithParamInterface; -class PeerConnectionIntegrationTest - : public PeerConnectionIntegrationBaseTest, - public ::testing::WithParamInterface<SdpSemantics> { +class PeerConnectionIntegrationTest : public PeerConnectionIntegrationBaseTest, + public WithParamInterface<SdpSemantics> { protected: PeerConnectionIntegrationTest() : PeerConnectionIntegrationBaseTest(GetParam()) {} @@ -169,9 +172,8 @@ TEST_P(PeerConnectionIntegrationTest, callee()->AddAudioVideoTracks(); // Start offer/answer exchange and wait for it to complete. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Should be one receiver each for audio/video. EXPECT_EQ(2U, caller()->rtp_receiver_observers().size()); EXPECT_EQ(2U, callee()->rtp_receiver_observers().size()); @@ -184,7 +186,7 @@ TEST_P(PeerConnectionIntegrationTest, return o->first_packet_received(); }); }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); EXPECT_THAT(WaitUntil( [&] { @@ -194,7 +196,7 @@ TEST_P(PeerConnectionIntegrationTest, return o->first_packet_received(); }); }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); // If new observers are set after the first packet was already received, the // callback should still be invoked. @@ -221,9 +223,8 @@ TEST_P(PeerConnectionIntegrationTest, RtpSenderObserverOnFirstPacketSent) { callee()->AddAudioVideoTracks(); // Start offer/answer exchange and wait for it to complete. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Should be one sender each for audio/video. EXPECT_EQ(2U, caller()->rtp_sender_observers().size()); EXPECT_EQ(2U, callee()->rtp_sender_observers().size()); @@ -236,7 +237,7 @@ TEST_P(PeerConnectionIntegrationTest, RtpSenderObserverOnFirstPacketSent) { return o->first_packet_sent(); }); }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); EXPECT_THAT(WaitUntil( [&] { @@ -246,7 +247,7 @@ TEST_P(PeerConnectionIntegrationTest, RtpSenderObserverOnFirstPacketSent) { return o->first_packet_sent(); }); }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); // If new observers are set after the first packet was already sent, the // callback should still be invoked. @@ -301,9 +302,8 @@ void TestDtmfFromSenderToReceiver(PeerConnectionIntegrationWrapper* sender, EXPECT_TRUE(dtmf_sender->CanInsertDtmf()); EXPECT_TRUE(dtmf_sender->InsertDtmf("1a", 100, 50)); - EXPECT_THAT( - WaitUntil([&] { return observer.completed(); }, ::testing::IsTrue()), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer.completed(); }, IsTrue()), + IsRtcOk()); std::vector<std::string> tones = {"1", "a", ""}; EXPECT_EQ(tones, observer.tones()); dtmf_sender->UnregisterObserver(); @@ -319,12 +319,10 @@ TEST_P(PeerConnectionIntegrationTest, DtmfSenderObserver) { caller()->AddAudioTrack(); callee()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); - // DTLS must finish before the DTMF sender can be used reliably. - ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, ::testing::IsTrue()), + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), IsRtcOk()); + // DTLS must finish before the DTMF sender can be used reliably. + ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, IsTrue()), IsRtcOk()); TestDtmfFromSenderToReceiver(caller(), callee()); TestDtmfFromSenderToReceiver(callee(), caller()); } @@ -340,9 +338,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithDtls) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -367,9 +364,8 @@ TEST_P(PeerConnectionIntegrationTest, caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -399,7 +395,7 @@ TEST_P(PeerConnectionIntegrationTest, 0 && callee()->min_video_frames_received_per_track() > 0; }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); // Check rendered aspect ratio. @@ -437,9 +433,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithSendOnlyVideo) { options.offer_to_receive_video = 0; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(callee()->pc()->GetReceivers().size(), 1u); // Expect video to be received in one direction. @@ -464,9 +459,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithReceiveOnlyVideo) { options.offer_to_receive_video = 1; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(caller()->pc()->GetReceivers().size(), 1u); // Expect video to be received in one direction. @@ -486,18 +480,16 @@ TEST_P(PeerConnectionIntegrationTest, caller()->CreateLocalVideoTrack(); caller()->AddTrack(caller_track); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Add receive video. scoped_refptr<VideoTrackInterface> callee_track = callee()->CreateLocalVideoTrack(); callee()->AddTrack(callee_track); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Ensure that video frames are received end-to-end. MediaExpectations media_expectations; @@ -514,18 +506,16 @@ TEST_P(PeerConnectionIntegrationTest, callee()->CreateLocalVideoTrack(); callee()->AddTrack(callee_track); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Add send video. scoped_refptr<VideoTrackInterface> caller_track = caller()->CreateLocalVideoTrack(); caller()->AddTrack(caller_track); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Expect video to be received in one direction. MediaExpectations media_expectations; @@ -549,17 +539,15 @@ TEST_P(PeerConnectionIntegrationTest, scoped_refptr<RtpSenderInterface> callee_sender = callee()->AddTrack(callee_track); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Remove receive video (i.e., callee sender track). callee()->pc()->RemoveTrackOrError(callee_sender); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Expect one-directional video. MediaExpectations media_expectations; @@ -585,17 +573,15 @@ TEST_P(PeerConnectionIntegrationTest, scoped_refptr<RtpSenderInterface> callee_sender = callee()->AddTrack(callee_track); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Remove send video (i.e., caller sender track). caller()->pc()->RemoveTrackOrError(caller_sender); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Expect one-directional video. MediaExpectations media_expectations; @@ -626,9 +612,8 @@ TEST_P(PeerConnectionIntegrationTest, AudioToVideoUpgrade) { } // Do offer/answer and make sure audio is still received end-to-end. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); { MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudio(); @@ -664,9 +649,8 @@ TEST_P(PeerConnectionIntegrationTest, AudioToVideoUpgrade) { }); } callee()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); { // Expect additional audio frames to be received after the upgrade. MediaExpectations media_expectations; @@ -684,16 +668,14 @@ TEST_P(PeerConnectionIntegrationTest, AddAudioToVideoOnlyCall) { caller()->AddVideoTrack(); callee()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Now add an audio track and do another offer/answer. caller()->AddAudioTrack(); callee()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Ensure both audio and video frames are received end-to-end. MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); @@ -715,9 +697,8 @@ TEST_P(PeerConnectionIntegrationTest, BundlingEnabledWhileIceRestartOccurs) { sdp->description()->RemoveGroupByName("BUNDLE"); }); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); { MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); @@ -727,9 +708,8 @@ TEST_P(PeerConnectionIntegrationTest, BundlingEnabledWhileIceRestartOccurs) { callee()->SetReceivedSdpMunger(nullptr); caller()->SetOfferAnswerOptions(IceRestartOfferAnswerOptions()); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Expect additional frames to be received after the ICE restart. { @@ -754,16 +734,15 @@ TEST_P(PeerConnectionIntegrationTest, RotatedVideoWithCVOExtension) { // Wait for video frames to be received by both sides. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_THAT(WaitUntil( [&] { return caller()->min_video_frames_received_per_track() > 0 && callee()->min_video_frames_received_per_track() > 0; }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); // Ensure that the aspect ratio is unmodified. @@ -798,16 +777,15 @@ TEST_P(PeerConnectionIntegrationTest, RotatedVideoWithoutCVOExtension) { }); // Wait for video frames to be received by both sides. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_THAT(WaitUntil( [&] { return caller()->min_video_frames_received_per_track() > 0 && callee()->min_video_frames_received_per_track() > 0; }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); // Expect that the aspect ratio is inversed to account for the 90/270 degree @@ -845,9 +823,8 @@ TEST_P(PeerConnectionIntegrationTest, AnswererRejectsAudioSection) { callee()->AddTrack(callee()->CreateLocalVideoTrack()); // Do offer/answer and wait for successful end-to-end video frames. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalVideo(); media_expectations.ExpectNoAudio(); @@ -888,9 +865,8 @@ TEST_P(PeerConnectionIntegrationTest, AnswererRejectsVideoSection) { callee()->AddTrack(callee()->CreateLocalAudioTrack()); // Do offer/answer and wait for successful end-to-end audio frames. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudio(); media_expectations.ExpectNoVideo(); @@ -935,9 +911,8 @@ TEST_P(PeerConnectionIntegrationTest, AnswererRejectsAudioAndVideoSections) { } // Do offer/answer and wait for stable signaling state. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Sanity check that the callee's description has rejected m= sections. ASSERT_NE(nullptr, callee()->pc()->local_description()); @@ -961,9 +936,8 @@ TEST_P(PeerConnectionIntegrationTest, VideoRejectedInSubsequentOffer) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); { MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); @@ -983,10 +957,9 @@ TEST_P(PeerConnectionIntegrationTest, VideoRejectedInSubsequentOffer) { caller()->GetFirstTransceiverOfType(MediaType::VIDEO)->StopInternal(); } caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue(), - {.timeout = kMaxWaitForActivation}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue(), + {.timeout = kMaxWaitForActivation}), + IsRtcOk()); // Sanity check that the caller's description has a rejected video section. ASSERT_NE(nullptr, caller()->pc()->local_description()); @@ -1015,9 +988,8 @@ TEST_F(PeerConnectionIntegrationTestPlanB, EnableAudioAfterRejecting) { scoped_refptr<RtpSenderInterface> sender = caller()->pc()->AddTrack(track, {"stream"}).MoveValue(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Remove audio track, and set offer_to_receive_audio to false to cause the // m= section to be completely disabled, not just "recvonly". @@ -1026,9 +998,8 @@ TEST_F(PeerConnectionIntegrationTestPlanB, EnableAudioAfterRejecting) { options.offer_to_receive_audio = 0; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Add the audio track again, expecting negotiation to succeed and frames to // flow. @@ -1036,9 +1007,8 @@ TEST_F(PeerConnectionIntegrationTestPlanB, EnableAudioAfterRejecting) { options.offer_to_receive_audio = 1; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudio(); @@ -1059,9 +1029,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithoutSsrcOrMsidSignaling) { // Remove SSRCs and MSIDs from the received offer SDP. callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1082,9 +1051,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, // Remove SSRCs from the received offer SDP. callee()->SetReceivedSdpMunger(RemoveSsrcsAndKeepMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudio(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1103,9 +1071,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto video_sender = caller()->pc()->AddTransceiver(track, video_transceiver_init).MoveValue(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Add receive direction. video_sender->SetDirectionWithError(RtpTransceiverDirection::kSendRecv); @@ -1115,9 +1082,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, callee()->AddTrack(callee_track); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Ensure that video frames are received end-to-end. MediaExpectations media_expectations; media_expectations.ExpectBidirectionalVideo(); @@ -1139,9 +1105,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->SetReceivedSdpMunger(&RemoveSsrcsAndKeepMsids); callee()->SetReceivedSdpMunger(&RemoveSsrcsAndKeepMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(2u, caller()->pc()->GetReceivers().size()); ASSERT_EQ(2u, callee()->pc()->GetReceivers().size()); @@ -1186,9 +1151,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->SetReceivedSdpMunger(&RemoveBundleGroupSsrcsAndMidExtension); callee()->SetReceivedSdpMunger(&RemoveBundleGroupSsrcsAndMidExtension); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(2u, caller()->pc()->GetReceivers().size()); ASSERT_EQ(2u, callee()->pc()->GetReceivers().size()); // Make sure we are not bundled. @@ -1238,9 +1202,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->SetReceivedSdpMunger(&RemoveSsrcsAndKeepMsids); callee()->SetReceivedSdpMunger(&RemoveSsrcsAndKeepMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(2u, caller()->pc()->GetReceivers().size()); ASSERT_EQ(2u, callee()->pc()->GetReceivers().size()); // Make sure we are bundled. @@ -1259,9 +1222,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, NoStreamsMsidLinePresent) { caller()->AddAudioTrack(); caller()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); auto callee_receivers = callee()->pc()->GetReceivers(); ASSERT_EQ(2u, callee_receivers.size()); EXPECT_TRUE(callee_receivers[0]->stream_ids().empty()); @@ -1275,9 +1237,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, NoStreamsMsidLineMissing) { caller()->AddVideoTrack(); callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); auto callee_receivers = callee()->pc()->GetReceivers(); ASSERT_EQ(2u, callee_receivers.size()); ASSERT_EQ(1u, callee_receivers[0]->stream_ids().size()); @@ -1315,15 +1276,14 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, EndToEndCallForwardsCsrcs) { caller()->CreateAndSetAndSignalOffer(); // Wait for some packets to arrive. - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_THAT(WaitUntil( [&] { return callee()->audio_frames_received() > 0 && callee()->min_video_frames_received_per_track() > 0; }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); std::vector<scoped_refptr<RtpReceiverInterface>> audio_receivers = @@ -1363,15 +1323,14 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, EndToEndCallCanUpdateCsrcs) { caller()->CreateAndSetAndSignalOffer(); // Wait for some packets to arrive. - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_THAT(WaitUntil( [&] { return callee()->audio_frames_received() > 0 && callee()->min_video_frames_received_per_track() > 0; }, - ::testing::IsTrue(), {.timeout = kMaxWaitForFrames}), + IsTrue(), {.timeout = kMaxWaitForFrames}), IsRtcOk()); // Update the CSRCs. @@ -1411,9 +1370,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithTwoVideoTracks) { caller()->AddAudioVideoTracks(); caller()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(3u, callee()->pc()->GetReceivers().size()); MediaExpectations media_expectations; @@ -1462,9 +1420,8 @@ TEST_P(PeerConnectionIntegrationTest, // but the first m= section. callee()->SetReceivedSdpMunger(MakeSpecCompliantMaxBundleOffer); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1479,15 +1436,14 @@ TEST_P(PeerConnectionIntegrationTest, GetAudioOutputLevelStatsWithOldStatsApi) { // Just add an audio track. caller()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Get the audio output level stats. Note that the level is not available // until an RTCP packet has been received. EXPECT_THAT( WaitUntil([&] { return callee()->OldGetStats()->AudioOutputLevel(); }, - ::testing::Gt(0), {.timeout = kMaxWaitForFrames}), + Gt(0), {.timeout = kMaxWaitForFrames}), IsRtcOk()); } @@ -1500,15 +1456,14 @@ TEST_P(PeerConnectionIntegrationTest, GetAudioInputLevelStatsWithOldStatsApi) { // Just add an audio track. caller()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Get the audio input level stats. The level should be available very // soon after the test starts. EXPECT_THAT( WaitUntil([&] { return caller()->OldGetStats()->AudioInputLevel(); }, - ::testing::Gt(0), {.timeout = kMaxWaitForStats}), + Gt(0), {.timeout = kMaxWaitForStats}), IsRtcOk()); } @@ -1519,9 +1474,8 @@ TEST_P(PeerConnectionIntegrationTest, GetBytesReceivedStatsWithOldStatsApi) { caller()->AddAudioVideoTracks(); // Do offer/answer, wait for the callee to receive some frames. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudioAndVideo(); @@ -1548,9 +1502,8 @@ TEST_P(PeerConnectionIntegrationTest, GetBytesSentStatsWithOldStatsApi) { caller()->AddTrack(video_track); // Do offer/answer, wait for the callee to receive some frames. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1573,15 +1526,14 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto audio_sender_2 = caller()->AddAudioTrack(); auto video_sender_2 = caller()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudioAndVideo(); - ASSERT_THAT(WaitUntil([&] { return ExpectNewFrames(media_expectations); }, - ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT( + WaitUntil([&] { return ExpectNewFrames(media_expectations); }, IsTrue()), + IsRtcOk()); std::vector<std::string> track_ids = { audio_sender_1->track()->id(), video_sender_1->track()->id(), @@ -1604,15 +1556,14 @@ TEST_P(PeerConnectionIntegrationTest, NewGetStatsManyAudioAndManyVideoStreams) { auto audio_sender_2 = caller()->AddAudioTrack(); auto video_sender_2 = caller()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudioAndVideo(); - ASSERT_THAT(WaitUntil([&] { return ExpectNewFrames(media_expectations); }, - ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT( + WaitUntil([&] { return ExpectNewFrames(media_expectations); }, IsTrue()), + IsRtcOk()); std::vector<std::string> track_ids = { audio_sender_1->track()->id(), video_sender_1->track()->id(), @@ -1673,9 +1624,8 @@ TEST_P(PeerConnectionIntegrationTest, // Remove SSRCs and MSIDs from the received offer SDP. callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudio(1); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1700,9 +1650,8 @@ TEST_P(PeerConnectionIntegrationTest, // Remove SSRCs and MSIDs from the received offer SDP. callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Note that, since the old stats implementation associates SSRCs with tracks // using SDP, when SSRCs aren't signaled in SDP these stats won't have an @@ -1712,7 +1661,7 @@ TEST_P(PeerConnectionIntegrationTest, // return cached stats if not enough time has passed since the last update. EXPECT_THAT( WaitUntil([&] { return callee()->OldGetStats()->BytesReceived(); }, - ::testing::Gt(0)), + Gt(0)), IsRtcOk()); } @@ -1726,9 +1675,8 @@ TEST_P(PeerConnectionIntegrationTest, // Remove SSRCs and MSIDs from the received offer SDP. callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudio(1); media_expectations.CalleeExpectsSomeVideo(1); @@ -1755,9 +1703,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithDtls10) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1773,19 +1720,17 @@ TEST_P(PeerConnectionIntegrationTest, Dtls10CipherStatsAndUmaMetrics) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, IsTrue()), IsRtcOk()); EXPECT_THAT(WaitUntil( [&] { return SSLStreamAdapter::IsAcceptableCipher( caller()->OldGetStats()->DtlsCipher(), KT_DEFAULT); }, - ::testing::IsTrue()), + IsTrue()), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return caller()->OldGetStats()->SrtpCipher(); }, + Eq(SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite))), IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return caller()->OldGetStats()->SrtpCipher(); }, - ::testing::Eq(SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite))), - IsRtcOk()); } // Test getting cipher stats and UMA metrics when DTLS 1.2 is negotiated. @@ -1798,19 +1743,17 @@ TEST_P(PeerConnectionIntegrationTest, Dtls12CipherStatsAndUmaMetrics) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, IsTrue()), IsRtcOk()); EXPECT_THAT(WaitUntil( [&] { return SSLStreamAdapter::IsAcceptableCipher( caller()->OldGetStats()->DtlsCipher(), KT_DEFAULT); }, - ::testing::IsTrue()), + IsTrue()), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return caller()->OldGetStats()->SrtpCipher(); }, + Eq(SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite))), IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return caller()->OldGetStats()->SrtpCipher(); }, - ::testing::Eq(SrtpCryptoSuiteToName(kDefaultSrtpCryptoSuite))), - IsRtcOk()); } // Test that DTLS 1.0 can be used if the caller supports DTLS 1.2 and the @@ -1828,9 +1771,8 @@ TEST_P(PeerConnectionIntegrationTest, CallerDtls12ToCalleeDtls10) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1851,9 +1793,8 @@ TEST_P(PeerConnectionIntegrationTest, CallerDtls10ToCalleeDtls12) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1932,9 +1873,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithGcmCipher) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -1949,31 +1889,26 @@ TEST_P(PeerConnectionIntegrationTest, IceStatesReachCompletion) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return caller()->ice_gathering_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceGatheringComplete), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return callee()->ice_gathering_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceGatheringComplete), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return caller()->ice_gathering_state(); }, + Eq(PeerConnectionInterface::kIceGatheringComplete), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return callee()->ice_gathering_state(); }, + Eq(PeerConnectionInterface::kIceGatheringComplete), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); // After the best candidate pair is selected and all candidates are signaled, // the ICE connection state should reach "complete". // TODO(deadbeef): Currently, the ICE "controlled" agent (the // answerer/"callee" by default) only reaches "connected". When this is // fixed, this test should be updated. EXPECT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionCompleted)), + Eq(PeerConnectionInterface::kIceConnectionCompleted)), IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionConnected)), + Eq(PeerConnectionInterface::kIceConnectionConnected)), IsRtcOk()); } @@ -2035,16 +1970,13 @@ TEST_P(PeerConnectionIntegrationTest, caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionCompleted)), + Eq(PeerConnectionInterface::kIceConnectionCompleted)), IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionConnected)), + Eq(PeerConnectionInterface::kIceConnectionConnected)), IsRtcOk()); // Part of reporting the stats will occur on the network thread, so flush it @@ -2061,7 +1993,7 @@ TEST_P(PeerConnectionIntegrationTest, // disconnected state and then removing the firewall causes them to reconnect. class PeerConnectionIntegrationIceStatesTest : public PeerConnectionIntegrationBaseTest, - public ::testing::WithParamInterface< + public WithParamInterface< std::tuple<SdpSemantics, std::tuple<std::string, uint32_t>>> { protected: PeerConnectionIntegrationIceStatesTest() @@ -2150,7 +2082,7 @@ TEST_P(PeerConnectionIntegrationIceStatesTestWithFakeClock, ScopedFakeClock& fake_clock = FakeClock(); ASSERT_THAT( WaitUntil([&] { return caller()->standardized_ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionFailed), + Eq(PeerConnectionInterface::kIceConnectionFailed), {.timeout = kConsentTimeout, .clock = &fake_clock}), IsRtcOk()); } @@ -2175,16 +2107,13 @@ TEST_P(PeerConnectionIntegrationIceStatesTest, MAYBE_VerifyBestConnection) { callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionCompleted)), + Eq(PeerConnectionInterface::kIceConnectionCompleted)), IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionConnected)), + Eq(PeerConnectionInterface::kIceConnectionConnected)), IsRtcOk()); // Part of reporting the stats will occur on the network thread, so flush it @@ -2250,19 +2179,16 @@ TEST_P(PeerConnectionIntegrationTest, MediaContinuesFlowingAfterIceRestart) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionCompleted), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionConnected), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionCompleted), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionConnected), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); // To verify that the ICE restart actually occurs, get // ufrag/password/candidates before and after restart. @@ -2289,19 +2215,16 @@ TEST_P(PeerConnectionIntegrationTest, MediaContinuesFlowingAfterIceRestart) { // Have the caller initiate an ICE restart. caller()->SetOfferAnswerOptions(IceRestartOfferAnswerOptions()); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionCompleted), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionConnected), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionCompleted), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionConnected), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); // Grab the ufrags/candidates again. audio_candidates_caller = caller()->pc()->local_description()->candidates(0); @@ -2343,9 +2266,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithIceRenomination) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Sanity check that ICE renomination was actually negotiated. const SessionDescription* desc = caller()->pc()->local_description()->description(); @@ -2375,21 +2297,18 @@ TEST_P(PeerConnectionIntegrationTest, caller()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionCompleted)), + Eq(PeerConnectionInterface::kIceConnectionCompleted)), IsRtcOk()); caller()->clear_ice_connection_state_history(); caller()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); EXPECT_EQ(0u, caller()->ice_connection_state_history().size()); } @@ -2406,9 +2325,8 @@ TEST_P(PeerConnectionIntegrationTest, // video and audio recvonly "m=" sections. caller()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Negotiate again, disabling the video "m=" section (the callee will set the // port to 0 due to offer_to_receive_video = 0). @@ -2422,9 +2340,8 @@ TEST_P(PeerConnectionIntegrationTest, }); } caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Sanity check that video "m=" section was actually rejected. const ContentInfo* answer_video_content = GetFirstVideoContent(callee()->pc()->local_description()->description()); @@ -2447,9 +2364,8 @@ TEST_P(PeerConnectionIntegrationTest, callee()->AddVideoTrack(); callee()->SetRemoteOfferHandler(nullptr); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Verify the caller receives frames from the newly added stream, and the // callee receives additional frames from the re-enabled video m= section. @@ -2475,21 +2391,18 @@ TEST_F(PeerConnectionIntegrationTestPlanB, auto callee_video_sender = callee()->pc()->CreateSender("video", "callee_stream"); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue(), - {.timeout = kMaxWaitForActivation}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue(), + {.timeout = kMaxWaitForActivation}), + IsRtcOk()); // Wait for ICE to complete, without any tracks being set. - EXPECT_THAT( - WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionCompleted), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionConnected), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionCompleted), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionConnected), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); // Now set the tracks, and expect frames to immediately start flowing. EXPECT_TRUE( caller_audio_sender->SetTrack(caller()->CreateLocalAudioTrack().get())); @@ -2525,21 +2438,18 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, RtpTransceiverDirection::kSendRecv); }); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue(), - {.timeout = kMaxWaitForActivation}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue(), + {.timeout = kMaxWaitForActivation}), + IsRtcOk()); // Wait for ICE to complete, without any tracks being set. - EXPECT_THAT( - WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionCompleted), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionConnected), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionCompleted), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionConnected), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); // Now set the tracks, and expect frames to immediately start flowing. auto callee_audio_sender = callee()->pc()->GetSenders()[0]; auto callee_video_sender = callee()->pc()->GetSenders()[1]; @@ -2566,20 +2476,18 @@ TEST_F(PeerConnectionIntegrationTestPlanB, CanSendRemoteVideoTrack) { // Just send a video track from the caller. caller()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue(), - {.timeout = kMaxWaitForActivation}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue(), + {.timeout = kMaxWaitForActivation}), + IsRtcOk()); ASSERT_EQ(1U, callee()->remote_streams()->count()); // Echo the stream back, and do a new offer/anwer (initiated by callee this // time). callee()->pc()->AddStream(callee()->remote_streams()->at(0)); callee()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue(), - {.timeout = kMaxWaitForActivation}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue(), + {.timeout = kMaxWaitForActivation}), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalVideo(); @@ -2667,7 +2575,7 @@ TEST_P(PeerConnectionIntegrationTestWithFakeClock, options.offer_to_receive_video = 1; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - EXPECT_THAT(WaitUntil([&] { return DtlsConnected(); }, ::testing::IsTrue(), + EXPECT_THAT(WaitUntil([&] { return DtlsConnected(); }, IsTrue(), {.timeout = TimeDelta::Millis(total_connection_time_ms), .clock = &FakeClock()}), IsRtcOk()); @@ -2715,7 +2623,7 @@ TEST_P(PeerConnectionIntegrationTestWithFakeClock, // signalled. caller()->CreateAndSetAndSignalOffer(); ASSERT_THAT(WaitUntil([&] { return caller()->IceGatheringStateComplete(); }, - ::testing::IsTrue(), {.clock = &FakeClock()}), + IsTrue(), {.clock = &FakeClock()}), IsRtcOk()); // Call getStats, assert there are no candidates. @@ -2733,9 +2641,8 @@ TEST_P(PeerConnectionIntegrationTestWithFakeClock, "candidate:2214029314 1 udp 2122260223 127.0.0.1 49152 typ host", nullptr)), [&result](RTCError r) { result = r; }); - ASSERT_THAT( - WaitUntil([&] { return result.has_value(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return result.has_value(); }, IsTrue()), + IsRtcOk()); ASSERT_TRUE(result.value().ok()); // Call getStats again, assert there is a remote candidate now. @@ -2796,8 +2703,7 @@ TEST_P(PeerConnectionIntegrationTest, TurnCustomizerUsedForTurnConnections) { options.offer_to_receive_video = 1; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, IsTrue()), IsRtcOk()); ExpectTurnCustomizerCountersIncremented(customizer1); ExpectTurnCustomizerCountersIncremented(customizer2); @@ -2834,14 +2740,12 @@ TEST_P(PeerConnectionIntegrationTest, TCPUsedForTurnConnections) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceConnectionConnected), - {.timeout = kMaxWaitForFrames}), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, + Eq(PeerConnectionInterface::kIceConnectionConnected), + {.timeout = kMaxWaitForFrames}), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); @@ -2906,8 +2810,7 @@ TEST_P(PeerConnectionIntegrationTest, options.offer_to_receive_video = 1; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, IsTrue()), IsRtcOk()); EXPECT_GT(client_1_cert_verifier->call_count_, 0u); EXPECT_GT(client_2_cert_verifier->call_count_, 0u); @@ -2978,9 +2881,8 @@ TEST_P(PeerConnectionIntegrationTest, CodecNamesAreCaseInsensitive) { }); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Verify frames are still received end-to-end. MediaExpectations media_expectations; @@ -2993,9 +2895,8 @@ TEST_P(PeerConnectionIntegrationTest, GetSourcesAudio) { ConnectFakeSignaling(); caller()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Wait for one audio frame to be received by the callee. MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudio(1); @@ -3015,9 +2916,8 @@ TEST_P(PeerConnectionIntegrationTest, GetSourcesVideo) { ConnectFakeSignaling(); caller()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Wait for two video frames to be received by the callee. // TODO: https://issues.webrtc.org/42220900 - wait for only one frame again MediaExpectations media_expectations; @@ -3040,9 +2940,8 @@ TEST_P(PeerConnectionIntegrationTest, UnsignaledSsrcGetSourcesAudio) { caller()->AddAudioTrack(); callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(callee()->pc()->GetReceivers().size(), 1u); auto receiver = callee()->pc()->GetReceivers()[0]; std::vector<RtpSource> sources; @@ -3053,7 +2952,7 @@ TEST_P(PeerConnectionIntegrationTest, UnsignaledSsrcGetSourcesAudio) { return !sources.empty(); })(); }, - ::testing::IsTrue()), + IsTrue()), IsRtcOk()); ASSERT_GT(sources.size(), 0u); EXPECT_EQ(RtpSourceType::SSRC, sources[0].source_type()); @@ -3065,9 +2964,8 @@ TEST_P(PeerConnectionIntegrationTest, UnsignaledSsrcGetSourcesVideo) { caller()->AddVideoTrack(); callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(callee()->pc()->GetReceivers().size(), 1u); auto receiver = callee()->pc()->GetReceivers()[0]; std::vector<RtpSource> sources; @@ -3078,7 +2976,7 @@ TEST_P(PeerConnectionIntegrationTest, UnsignaledSsrcGetSourcesVideo) { return !sources.empty(); })(); }, - ::testing::IsTrue()), + IsTrue()), IsRtcOk()); ASSERT_GT(sources.size(), 0u); EXPECT_EQ(RtpSourceType::SSRC, sources[0].source_type()); @@ -3096,9 +2994,8 @@ TEST_P(PeerConnectionIntegrationTest, caller()->AddVideoTrack(); callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Wait for one video frame to be received by the callee. MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeVideo(1); @@ -3117,9 +3014,8 @@ TEST_P(PeerConnectionIntegrationTest, UnsignaledSsrcGetParametersAudio) { caller()->AddAudioTrack(); callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(callee()->pc()->GetReceivers().size(), 1u); auto receiver = callee()->pc()->GetReceivers()[0]; RtpParameters parameters; @@ -3131,7 +3027,7 @@ TEST_P(PeerConnectionIntegrationTest, UnsignaledSsrcGetParametersAudio) { parameters.encodings[0].ssrc.has_value(); })(); }, - ::testing::IsTrue()), + IsTrue()), IsRtcOk()); ASSERT_EQ(parameters.encodings.size(), 1u); EXPECT_TRUE(parameters.encodings[0].ssrc.has_value()); @@ -3143,9 +3039,8 @@ TEST_P(PeerConnectionIntegrationTest, UnsignaledSsrcGetParametersVideo) { caller()->AddVideoTrack(); callee()->SetReceivedSdpMunger(RemoveSsrcsAndMsids); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(callee()->pc()->GetReceivers().size(), 1u); auto receiver = callee()->pc()->GetReceivers()[0]; RtpParameters parameters; @@ -3157,7 +3052,7 @@ TEST_P(PeerConnectionIntegrationTest, UnsignaledSsrcGetParametersVideo) { parameters.encodings[0].ssrc.has_value(); })(); }, - ::testing::IsTrue()), + IsTrue()), IsRtcOk()); ASSERT_EQ(parameters.encodings.size(), 1u); EXPECT_TRUE(parameters.encodings[0].ssrc.has_value()); @@ -3187,9 +3082,8 @@ TEST_F(PeerConnectionIntegrationTestPlanB, RemoveAndAddTrackWithNewStreamId) { scoped_refptr<RtpSenderInterface> sender = caller()->AddTrack(track, {"stream_1"}); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); { MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudio(1); @@ -3199,9 +3093,8 @@ TEST_F(PeerConnectionIntegrationTestPlanB, RemoveAndAddTrackWithNewStreamId) { caller()->pc()->RemoveTrackOrError(sender); sender = caller()->AddTrack(track, {"stream_2"}); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Wait for additional audio frames to be received by the callee. { MediaExpectations media_expectations; @@ -3223,9 +3116,8 @@ TEST_P(PeerConnectionIntegrationTest, RtcEventLogOutputWriteCalled) { caller()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); } TEST_P(PeerConnectionIntegrationTest, RtcEventLogOutputWriteCalledOnStop) { @@ -3249,9 +3141,8 @@ TEST_P(PeerConnectionIntegrationTest, RtcEventLogOutputWriteCalledOnStop) { caller()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); caller()->pc()->StopRtcEventLog(); test_is_complete.Call(); @@ -3278,9 +3169,8 @@ TEST_P(PeerConnectionIntegrationTest, RtcEventLogOutputWriteCalledOnClose) { caller()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); caller()->pc()->Close(); test_is_complete.Call(); @@ -3301,21 +3191,18 @@ TEST_P(PeerConnectionIntegrationTest, MediaFlowsWhenCandidatesSetOnlyInSdp) { caller()->CreateAndSetAndSignalOffer(); // Wait for all candidates to be gathered on both the caller and callee. - ASSERT_THAT( - WaitUntil([&] { return caller()->ice_gathering_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceGatheringComplete)), - IsRtcOk()); - ASSERT_THAT( - WaitUntil([&] { return callee()->ice_gathering_state(); }, - ::testing::Eq(PeerConnectionInterface::kIceGatheringComplete)), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return caller()->ice_gathering_state(); }, + Eq(PeerConnectionInterface::kIceGatheringComplete)), + IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return callee()->ice_gathering_state(); }, + Eq(PeerConnectionInterface::kIceGatheringComplete)), + IsRtcOk()); // The candidates will now be included in the session description, so // signaling them will start the ICE connection. caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Ensure that media flows in both directions. MediaExpectations media_expectations; @@ -3339,9 +3226,8 @@ TEST_P(PeerConnectionIntegrationTest, DisableAndEnableAudioPlayout) { caller()->AddAudioTrack(); callee()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Pump messages for a second. WAIT(false, 1000); @@ -3384,13 +3270,12 @@ TEST_P(PeerConnectionIntegrationTest, caller()->pc()->SetAudioPlayout(false); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Wait for the callee to receive audio stats. - EXPECT_THAT(WaitUntil([&] { return GetAudioEnergyStat(caller()); }, - ::testing::Gt(0), {.timeout = kMaxWaitForFrames}), + EXPECT_THAT(WaitUntil([&] { return GetAudioEnergyStat(caller()); }, Gt(0), + {.timeout = kMaxWaitForFrames}), IsRtcOk()); } @@ -3409,9 +3294,8 @@ TEST_P(PeerConnectionIntegrationTest, DisableAndEnableAudioRecording) { caller()->AddAudioTrack(); callee()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Pump messages for a second. WAIT(false, 1000); @@ -3437,8 +3321,7 @@ TEST_P(PeerConnectionIntegrationTest, options.offer_to_receive_audio = 1; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, IsTrue()), IsRtcOk()); ASSERT_NE(nullptr, caller()->event_log_factory()); ASSERT_NE(nullptr, callee()->event_log_factory()); FakeRtcEventLog* caller_event_log = @@ -3492,20 +3375,17 @@ TEST_P(PeerConnectionIntegrationTest, RegatherAfterChangingIceTransportType) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Since we are doing continual gathering, the ICE transport does not reach // kIceGatheringComplete (see // P2PTransportChannel::OnCandidatesAllocationDone), and consequently not // kIceConnectionComplete. EXPECT_THAT(WaitUntil([&] { return caller()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionConnected)), + Eq(PeerConnectionInterface::kIceConnectionConnected)), IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return callee()->ice_connection_state(); }, - ::testing::Eq( - PeerConnectionInterface::kIceConnectionConnected)), + Eq(PeerConnectionInterface::kIceConnectionConnected)), IsRtcOk()); // Note that we cannot use the metric // `WebRTC.PeerConnection.CandidatePairType_UDP` in this test since this @@ -3521,7 +3401,7 @@ TEST_P(PeerConnectionIntegrationTest, RegatherAfterChangingIceTransportType) { // We should have gathered a new host candidate. EXPECT_THAT( WaitUntil([&] { return caller()->last_candidate_gathered().is_local(); }, - ::testing::IsTrue()), + IsTrue()), IsRtcOk()); // Loosen the callee's candidate filter. @@ -3530,7 +3410,7 @@ TEST_P(PeerConnectionIntegrationTest, RegatherAfterChangingIceTransportType) { callee()->pc()->SetConfiguration(callee_config); EXPECT_THAT( WaitUntil([&] { return callee()->last_candidate_gathered().is_local(); }, - ::testing::IsTrue()), + IsTrue()), IsRtcOk()); // Create an offer and verify that it does not contain an ICE restart (i.e new @@ -3580,12 +3460,11 @@ TEST_P(PeerConnectionIntegrationTest, OnIceCandidateError) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); - EXPECT_THAT(WaitUntil([&] { return caller()->error_event().error_code; }, - ::testing::Eq(401)), + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), IsRtcOk()); + EXPECT_THAT( + WaitUntil([&] { return caller()->error_event().error_code; }, Eq(401)), + IsRtcOk()); EXPECT_EQ("Unauthorized", caller()->error_event().error_text); EXPECT_EQ("turn:88.88.88.0:3478?transport=udp", caller()->error_event().url); EXPECT_NE(caller()->error_event().address, ""); @@ -3615,12 +3494,11 @@ TEST_P(PeerConnectionIntegrationTest, OnIceCandidateErrorWithEmptyAddress) { caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); - EXPECT_THAT(WaitUntil([&] { return caller()->error_event().error_code; }, - ::testing::Eq(701)), + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), IsRtcOk()); + EXPECT_THAT( + WaitUntil([&] { return caller()->error_event().error_code; }, Eq(701)), + IsRtcOk()); EXPECT_EQ(caller()->error_event().address, ""); } @@ -3636,9 +3514,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->AddAudioTrack(); callee()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudio(); ASSERT_TRUE(ExpectNewFrames(media_expectations)); @@ -3648,13 +3525,11 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto observer = make_ref_counted<MockSetSessionDescriptionObserver>(); callee()->pc()->SetLocalDescription(observer.get(), callee()->CreateOfferAndWait().release()); - EXPECT_THAT( - WaitUntil([&] { return observer->called(); }, ::testing::IsTrue()), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue()), + IsRtcOk()); caller()->CreateAndSetAndSignalOffer(); // Implicit rollback. - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_TRUE(ExpectNewFrames(media_expectations)); } @@ -3669,17 +3544,15 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto sld_observer = make_ref_counted<MockSetSessionDescriptionObserver>(); callee()->pc()->SetLocalDescription(sld_observer.get(), callee()->CreateOfferAndWait().release()); - EXPECT_THAT( - WaitUntil([&] { return sld_observer->called(); }, ::testing::IsTrue()), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return sld_observer->called(); }, IsTrue()), + IsRtcOk()); EXPECT_EQ(sld_observer->error(), ""); auto srd_observer = make_ref_counted<MockSetSessionDescriptionObserver>(); callee()->pc()->SetRemoteDescription( srd_observer.get(), caller()->CreateOfferAndWait().release()); - EXPECT_THAT( - WaitUntil([&] { return srd_observer->called(); }, ::testing::IsTrue()), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return srd_observer->called(); }, IsTrue()), + IsRtcOk()); EXPECT_EQ(srd_observer->error(), ""); EXPECT_THAT(callee()->peer_connection_signaling_state_history(), @@ -3714,9 +3587,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, // Munge remote answer for SRD. caller()->SetReceivedSdpMunger(munger); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Observe that after munging the parameter is present in generated SDP. caller()->SetGeneratedSdpMunger( [](std::unique_ptr<SessionDescriptionInterface>& sdp) { @@ -3741,9 +3613,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->pc()->AddTransceiver(MediaType::AUDIO); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); int current_size = caller()->pc()->GetTransceivers().size(); // Add more tracks until we get close to having issues. // Issues have been seen at: @@ -3759,9 +3630,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto start_time_ms = TimeMillis(); caller()->CreateAndSetAndSignalOffer(); // We want to stop when the time exceeds one second. - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); auto elapsed_time_ms = TimeMillis() - start_time_ms; RTC_LOG(LS_INFO) << "Renegotiating took " << elapsed_time_ms << " ms"; ASSERT_GT(1000, elapsed_time_ms) @@ -3779,9 +3649,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->pc()->AddTransceiver(MediaType::VIDEO); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); int current_size = caller()->pc()->GetTransceivers().size(); // Add more tracks until we get close to having issues. // Issues have been seen at: @@ -3799,9 +3668,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto start_time_ms = TimeMillis(); caller()->CreateAndSetAndSignalOffer(); // We want to stop when the time exceeds one second. - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); auto elapsed_time_ms = TimeMillis() - start_time_ms; RTC_LOG(LS_INFO) << "Renegotiating took " << elapsed_time_ms << " ms"; ASSERT_GT(1000, elapsed_time_ms) @@ -3819,9 +3687,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->AddAudioTrack(); callee()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Wait until we can see the audio flowing. MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudio(); @@ -3845,9 +3712,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto start_time_ms = TimeMillis(); caller()->CreateAndSetAndSignalOffer(); // We want to stop when the time exceeds one second. - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); auto elapsed_time_ms = TimeMillis() - start_time_ms; RTC_LOG(LS_INFO) << "Renegotiating took " << elapsed_time_ms << " ms"; // This is a guard against the test using excessive amounts of time. @@ -3895,8 +3761,7 @@ INSTANTIATE_TEST_SUITE_P(PeerConnectionIntegrationTest, // PeerConnections. class PeerConnectionIntegrationInteropTest : public PeerConnectionIntegrationBaseTest, - public ::testing::WithParamInterface< - std::tuple<SdpSemantics, SdpSemantics>> { + public WithParamInterface<std::tuple<SdpSemantics, SdpSemantics>> { protected: // Setting the SdpSemantics for the base test to kDefault does not matter // because we specify not to use the test semantics when creating @@ -3920,9 +3785,8 @@ TEST_P(PeerConnectionIntegrationInteropTest, NoMediaLocalToNoMediaRemote) { ConnectFakeSignaling(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); } TEST_P(PeerConnectionIntegrationInteropTest, OneAudioLocalToNoMediaRemote) { @@ -3931,9 +3795,8 @@ TEST_P(PeerConnectionIntegrationInteropTest, OneAudioLocalToNoMediaRemote) { auto audio_sender = caller()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Verify that one audio receiver has been created on the remote and that it // has the same track ID as the sending track. @@ -3954,9 +3817,8 @@ TEST_P(PeerConnectionIntegrationInteropTest, OneAudioOneVideoToNoMediaRemote) { auto audio_sender = caller()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Verify that one audio and one video receiver have been created on the // remote and that they have the same track IDs as the sending tracks. @@ -3980,9 +3842,8 @@ TEST_P(PeerConnectionIntegrationInteropTest, callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.ExpectBidirectionalAudioAndVideo(); @@ -3997,9 +3858,8 @@ TEST_P(PeerConnectionIntegrationInteropTest, callee()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Verify that only the audio track has been negotiated. EXPECT_EQ(0u, caller()->GetReceiversOfType(MediaType::VIDEO).size()); @@ -4007,9 +3867,8 @@ TEST_P(PeerConnectionIntegrationInteropTest, // Reverse roles. callee()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); MediaExpectations media_expectations; media_expectations.CallerExpectsSomeVideo(); @@ -4022,18 +3881,15 @@ TEST_P(PeerConnectionIntegrationTest, NewTracksDoNotCauseNewCandidates) { ConnectFakeSignaling(); caller()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); - ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, ::testing::IsTrue()), + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return DtlsConnected(); }, IsTrue()), IsRtcOk()); caller()->ExpectCandidates(0); callee()->ExpectCandidates(0); caller()->AddAudioTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); } TEST_P(PeerConnectionIntegrationTest, MediaCallWithoutMediaEngineFails) { @@ -4061,9 +3917,8 @@ TEST_F(PeerConnectionIntegrationTestPlanB, TwoVideoUnifiedPlanToNoMediaPlanB) { caller()->AddVideoTrack(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); // Verify that there is only one receiver and it corresponds to the first // added track. @@ -4094,9 +3949,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto audio_transceiver = audio_transceiver_or_error.MoveValue(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); { MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeAudio(); @@ -4107,9 +3961,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->pc()->AddTransceiver(caller()->CreateLocalVideoTrack()); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); { MediaExpectations media_expectations; media_expectations.CalleeExpectsSomeVideo(); @@ -4128,15 +3981,13 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto audio_transceiver = audio_transceiver_or_error.MoveValue(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); audio_transceiver->StopStandard(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(0U, caller()->pc()->GetTransceivers().size()); EXPECT_EQ(PeerConnectionInterface::kIceGatheringNew, caller()->pc()->ice_gathering_state()); @@ -4157,16 +4008,14 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto caller_transceiver = audio_transceiver_or_error.MoveValue(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); caller_transceiver->StopStandard(); auto callee_transceiver = callee()->pc()->GetTransceivers()[0]; caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); EXPECT_EQ(0U, caller()->pc()->GetTransceivers().size()); EXPECT_EQ(0U, callee()->pc()->GetTransceivers().size()); EXPECT_EQ(0U, caller()->pc()->GetSenders().size()); @@ -4188,18 +4037,16 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto audio_transceiver = audio_transceiver_or_error.MoveValue(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); auto caller_track = audio_transceiver->receiver()->track(); auto callee_track = callee()->pc()->GetReceivers()[0]->track(); audio_transceiver->StopStandard(); EXPECT_EQ(MediaStreamTrackInterface::TrackState::kEnded, caller_track->state()); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); EXPECT_EQ(MediaStreamTrackInterface::TrackState::kEnded, callee_track->state()); } @@ -4215,18 +4062,16 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto audio_transceiver = audio_transceiver_or_error.MoveValue(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); auto caller_track = audio_transceiver->receiver()->track(); auto callee_track = callee()->pc()->GetReceivers()[0]->track(); audio_transceiver->StopStandard(); EXPECT_EQ(MediaStreamTrackInterface::TrackState::kEnded, caller_track->state()); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); EXPECT_EQ(MediaStreamTrackInterface::TrackState::kEnded, callee_track->state()); } @@ -4243,9 +4088,8 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndRtpSenderVideoEncoderSelector) { options.offer_to_receive_video = 0; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(callee()->pc()->GetReceivers().size(), 1u); std::unique_ptr<MockEncoderSelector> encoder_selector = @@ -4275,25 +4119,24 @@ TEST_P(PeerConnectionIntegrationTest, options.offer_to_receive_video = 0; caller()->SetOfferAnswerOptions(options); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_EQ(callee()->pc()->GetReceivers().size(), 1u); std::unique_ptr<MockEncoderSelector> encoder_selector = std::make_unique<MockEncoderSelector>(); std::optional<SdpVideoFormat> next_format; EXPECT_CALL(*encoder_selector, OnCurrentEncoder) - .WillOnce(::testing::Invoke([&](const SdpVideoFormat& format) { + .WillOnce(Invoke([&](const SdpVideoFormat& format) { EXPECT_EQ(format.name, "VP8"); next_format = SdpVideoFormat::VP9Profile0(); })) - .WillOnce(::testing::Invoke([&](const SdpVideoFormat& format) { + .WillOnce(Invoke([&](const SdpVideoFormat& format) { EXPECT_EQ(format.name, "VP9"); })); EXPECT_CALL(*encoder_selector, OnAvailableBitrate) .WillRepeatedly( - ::testing::Invoke([&](const DataRate& rate) { return next_format; })); + Invoke([&](const DataRate& rate) { return next_format; })); sender->SetEncoderSelector(std::move(encoder_selector)); @@ -4378,15 +4221,13 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, // Wait until callee has sent at least one NACK. // Note that due to stats caching, this might only be visible 50 ms // after the nack was in fact sent. - EXPECT_THAT( - WaitUntil([&] { return NacksSentCount(*callee()); }, ::testing::Gt(0)), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return NacksSentCount(*callee()); }, Gt(0)), + IsRtcOk()); ASSERT_FALSE(HasFailure()); virtual_socket_server()->set_drop_probability(0.0); // Wait until caller has received at least one NACK - EXPECT_THAT(WaitUntil([&] { return NacksReceivedCount(*caller()); }, - ::testing::Gt(0)), + EXPECT_THAT(WaitUntil([&] { return NacksReceivedCount(*caller()); }, Gt(0)), IsRtcOk()); } @@ -4431,14 +4272,12 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, VideoPacketLossCausesNack) { // Wait until callee has sent at least one NACK. // Note that due to stats caching, this might only be visible 50 ms // after the nack was in fact sent. - EXPECT_THAT( - WaitUntil([&] { return NacksSentCount(*callee()); }, ::testing::Gt(0)), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return NacksSentCount(*callee()); }, Gt(0)), + IsRtcOk()); ASSERT_FALSE(HasFailure()); // Wait until caller has received at least one NACK - EXPECT_THAT(WaitUntil([&] { return NacksReceivedCount(*caller()); }, - ::testing::Gt(0)), + EXPECT_THAT(WaitUntil([&] { return NacksReceivedCount(*caller()); }, Gt(0)), IsRtcOk()); } @@ -4647,14 +4486,13 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->NegotiateCorruptionDetectionHeader(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_THAT(WaitUntil([&] { return caller()->GetReceivedFrameCount(); }, - ::testing::Eq(3), {.timeout = kMaxWaitForStats}), + Eq(3), {.timeout = kMaxWaitForStats}), IsRtcOk()); ASSERT_THAT(WaitUntil([&] { return callee()->GetReceivedFrameCount(); }, - ::testing::Eq(3), {.timeout = kMaxWaitForStats}), + Eq(3), {.timeout = kMaxWaitForStats}), IsRtcOk()); for (const auto& pair : {caller(), callee()}) { @@ -4695,14 +4533,13 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, callee()->NegotiateCorruptionDetectionHeader(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_THAT(WaitUntil([&] { return caller()->GetCorruptionScoreCount(); }, - ::testing::Gt(0), {.timeout = kMaxWaitForStats}), + Gt(0), {.timeout = kMaxWaitForStats}), IsRtcOk()); ASSERT_THAT(WaitUntil([&] { return callee()->GetCorruptionScoreCount(); }, - ::testing::Gt(0), {.timeout = kMaxWaitForStats}), + Gt(0), {.timeout = kMaxWaitForStats}), IsRtcOk()); for (const auto& pair : {caller(), callee()}) { @@ -4748,14 +4585,13 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, caller()->AddAudioVideoTracks(); callee()->AddAudioVideoTracks(); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); ASSERT_THAT(WaitUntil([&] { return caller()->GetCorruptionScoreCount(); }, - ::testing::Eq(0), {.timeout = kMaxWaitForStats}), + Eq(0), {.timeout = kMaxWaitForStats}), IsRtcOk()); ASSERT_THAT(WaitUntil([&] { return callee()->GetCorruptionScoreCount(); }, - ::testing::Eq(0), {.timeout = kMaxWaitForStats}), + Eq(0), {.timeout = kMaxWaitForStats}), IsRtcOk()); for (const auto& pair : {caller(), callee()}) { @@ -4792,9 +4628,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, ASSERT_TRUE(transceiver->SetHeaderExtensionsToNegotiate(extensions).ok()); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); const auto& negotiated_header_extensions = caller() ->pc() ->remote_description() @@ -4810,7 +4645,7 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, [&] { return metrics::NumSamples("WebRTC.Call.AbsCapture.ExtensionWait"); }, - ::testing::Gt(0)), + Gt(0)), IsRtcOk()); // Observed deltas are more than 100 msec. Use 1 minute as tolerance; // this is a check against wrong timebase. @@ -4820,7 +4655,7 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, [&] { return metrics::NumSamples("WebRTC.Call.AbsCapture.OffsetWait"); }, - ::testing::Gt(0)), + Gt(0)), IsRtcOk()); // On a point-to-point call, we expect the offset to be zero. EXPECT_LT(metrics::MinSample("WebRTC.Call.AbsCapture.Offset"), 2); @@ -4860,9 +4695,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, }; caller()->SetGeneratedSdpMunger(munger); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); caller()->SetGeneratedSdpMunger(nullptr); std::unique_ptr<SessionDescriptionInterface> offer = caller()->CreateOfferAndWait(); @@ -4905,9 +4739,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, }; caller()->SetGeneratedSdpMunger(munger); caller()->CreateAndSetAndSignalOffer(); - ASSERT_THAT( - WaitUntil([&] { return SignalingStateStable(); }, ::testing::IsTrue()), - IsRtcOk()); + ASSERT_THAT(WaitUntil([&] { return SignalingStateStable(); }, IsTrue()), + IsRtcOk()); caller()->SetGeneratedSdpMunger(nullptr); if (!has_munged) { @@ -5070,9 +4903,8 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan, auto observer = make_ref_counted<MockSetSessionDescriptionObserver>(); caller()->pc()->SetLocalDescription(observer.get(), offer.release()); // Wait for SLD to complete. - EXPECT_THAT( - WaitUntil([&] { return observer->called(); }, ::testing::IsTrue()), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue()), + IsRtcOk()); // Add a second video track. caller()->AddVideoTrack(); auto offer2 = caller()->CreateOfferAndWait(); @@ -5127,7 +4959,7 @@ TEST_P(PeerConnectionIntegrationTest, DtlsPqc) { return PeerConnectionStateIs( PeerConnectionInterface::PeerConnectionState::kConnected); }, - ::testing::IsTrue()), + IsTrue()), IsRtcOk()); uint16_t expected = @@ -5168,7 +5000,7 @@ TEST_P(PeerConnectionIntegrationTest, DtlsPqcFieldTrial) { return PeerConnectionStateIs( PeerConnectionInterface::PeerConnectionState::kConnected); }, - ::testing::IsTrue()), + IsTrue()), IsRtcOk()); uint16_t expected = diff --git a/third_party/libwebrtc/pc/peer_connection_interface_unittest.cc b/third_party/libwebrtc/pc/peer_connection_interface_unittest.cc @@ -100,6 +100,7 @@ namespace { using ::testing::Eq; using ::testing::Exactly; +using ::testing::IsTrue; using ::testing::NotNull; using ::testing::SizeIs; using ::testing::Values; @@ -851,10 +852,9 @@ class PeerConnectionInterfaceBaseTest : public ::testing::Test { pc_->CreateAnswer(observer.get(), options ? *options : RTCOfferAnswerOptions()); } - EXPECT_THAT( - WaitUntil([&] { return observer->called(); }, ::testing::IsTrue(), - {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue(), + {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); *desc = observer->MoveDescription(); return observer->result(); } @@ -879,10 +879,9 @@ class PeerConnectionInterfaceBaseTest : public ::testing::Test { pc_->SetRemoteDescription(observer.get(), desc.release()); } if (pc_->signaling_state() != PeerConnectionInterface::kClosed) { - EXPECT_THAT( - WaitUntil([&] { return observer->called(); }, ::testing::IsTrue(), - {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue(), + {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); } return observer->result(); } @@ -905,10 +904,9 @@ class PeerConnectionInterfaceBaseTest : public ::testing::Test { if (!pc_->GetStats(observer.get(), track, PeerConnectionInterface::kStatsOutputLevelStandard)) return false; - EXPECT_THAT( - WaitUntil([&] { return observer->called(); }, ::testing::IsTrue(), - {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue(), + {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); return observer->called(); } @@ -916,10 +914,9 @@ class PeerConnectionInterfaceBaseTest : public ::testing::Test { bool DoGetRTCStats() { auto callback = make_ref_counted<MockRTCStatsCollectorCallback>(); pc_->GetStats(callback.get()); - EXPECT_THAT( - WaitUntil([&] { return callback->called(); }, ::testing::IsTrue(), - {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return callback->called(); }, IsTrue(), + {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); return callback->called(); } @@ -1025,8 +1022,7 @@ class PeerConnectionInterfaceBaseTest : public ::testing::Test { EXPECT_EQ(PeerConnectionInterface::kHaveLocalOffer, observer_.state_); // Wait for the ice_complete message, so that SDP will have candidates. EXPECT_THAT(WaitUntil([&] { return observer_.ice_gathering_complete_; }, - ::testing::IsTrue(), - {.timeout = TimeDelta::Millis(kTimeout)}), + IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); } @@ -1057,15 +1053,14 @@ class PeerConnectionInterfaceBaseTest : public ::testing::Test { void WaitAndVerifyOnAddStream(const std::string& stream_id, int expected_num_tracks) { // Verify that both OnAddStream and OnAddTrack are called. - EXPECT_THAT(WaitUntil([&] { return observer_.GetLastAddedStreamId(); }, - ::testing::Eq(stream_id), - {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT( + WaitUntil([&] { return observer_.GetLastAddedStreamId(); }, + Eq(stream_id), {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); EXPECT_THAT( WaitUntil( [&] { return observer_.CountAddTrackEventsForStream(stream_id); }, - ::testing::Eq(expected_num_tracks), - {.timeout = TimeDelta::Millis(kTimeout)}), + Eq(expected_num_tracks), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); } @@ -1181,10 +1176,9 @@ class PeerConnectionInterfaceBaseTest : public ::testing::Test { RTC_DCHECK(pc_); auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>(); pc_->CreateOffer(observer.get(), offer_answer_options); - EXPECT_THAT( - WaitUntil([&] { return observer->called(); }, ::testing::IsTrue(), - {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue(), + {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); return observer->MoveDescription(); } @@ -1766,10 +1760,9 @@ TEST_P(PeerConnectionInterfaceTest, IceCandidates) { ::testing::Ne(nullptr), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); - EXPECT_THAT( - WaitUntil([&] { return observer_.ice_gathering_complete_; }, - ::testing::IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer_.ice_gathering_complete_; }, + IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); EXPECT_TRUE(pc_->AddIceCandidate(observer_.last_candidate())); } @@ -2445,11 +2438,11 @@ TEST_P(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { ASSERT_TRUE(video_receiver); // Track state may be updated asynchronously. EXPECT_THAT(WaitUntil([&] { return audio_receiver->track()->state(); }, - ::testing::Eq(MediaStreamTrackInterface::kEnded), + Eq(MediaStreamTrackInterface::kEnded), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return video_receiver->track()->state(); }, - ::testing::Eq(MediaStreamTrackInterface::kEnded), + Eq(MediaStreamTrackInterface::kEnded), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); } else { @@ -2571,11 +2564,11 @@ TEST_F(PeerConnectionInterfaceTestPlanB, reference_collection_.get())); // Track state may be updated asynchronously. EXPECT_THAT(WaitUntil([&] { return audio_track2->state(); }, - ::testing::Eq(MediaStreamTrackInterface::kEnded), + Eq(MediaStreamTrackInterface::kEnded), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return video_track2->state(); }, - ::testing::Eq(MediaStreamTrackInterface::kEnded), + Eq(MediaStreamTrackInterface::kEnded), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); } @@ -2622,11 +2615,11 @@ TEST_P(PeerConnectionInterfaceTest, RejectMediaContent) { EXPECT_TRUE(DoSetLocalDescription(std::move(local_offer))); // Track state may be updated asynchronously. EXPECT_THAT(WaitUntil([&] { return remote_audio->state(); }, - ::testing::Eq(MediaStreamTrackInterface::kEnded), + Eq(MediaStreamTrackInterface::kEnded), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); EXPECT_THAT(WaitUntil([&] { return remote_video->state(); }, - ::testing::Eq(MediaStreamTrackInterface::kEnded), + Eq(MediaStreamTrackInterface::kEnded), {.timeout = TimeDelta::Millis(kTimeout)}), IsRtcOk()); } @@ -3614,34 +3607,30 @@ TEST_F(PeerConnectionInterfaceTestPlanB, scoped_refptr<VideoTrackInterface> video_track( CreateVideoTrack("video_track")); stream->AddTrack(audio_track); - EXPECT_THAT( - WaitUntil([&] { return observer_.renegotiation_needed_; }, - ::testing::IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer_.renegotiation_needed_; }, + IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); observer_.renegotiation_needed_ = false; CreateOfferReceiveAnswer(); stream->AddTrack(video_track); - EXPECT_THAT( - WaitUntil([&] { return observer_.renegotiation_needed_; }, - ::testing::IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer_.renegotiation_needed_; }, + IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); observer_.renegotiation_needed_ = false; CreateOfferReceiveAnswer(); stream->RemoveTrack(audio_track); - EXPECT_THAT( - WaitUntil([&] { return observer_.renegotiation_needed_; }, - ::testing::IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer_.renegotiation_needed_; }, + IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); observer_.renegotiation_needed_ = false; CreateOfferReceiveAnswer(); stream->RemoveTrack(video_track); - EXPECT_THAT( - WaitUntil([&] { return observer_.renegotiation_needed_; }, - ::testing::IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), - IsRtcOk()); + EXPECT_THAT(WaitUntil([&] { return observer_.renegotiation_needed_; }, + IsTrue(), {.timeout = TimeDelta::Millis(kTimeout)}), + IsRtcOk()); observer_.renegotiation_needed_ = false; }