Use test::RunLoop in pc/rtp_transceiver_unittest.cc and fix shadowing Bug: webrtc:469327588 Change-Id: Iecfafc8824af9a91e420c7f5b5604cc96a6a6964 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/464461 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Auto-Submit: Evan Shrubsole <eshr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47477}
diff --git a/pc/rtp_transceiver_unittest.cc b/pc/rtp_transceiver_unittest.cc index 855bc2f..a7abb5b 100644 --- a/pc/rtp_transceiver_unittest.cc +++ b/pc/rtp_transceiver_unittest.cc
@@ -61,6 +61,7 @@ #include "test/create_test_environment.h" #include "test/gmock.h" #include "test/gtest.h" +#include "test/run_loop.h" using ::testing::_; using ::testing::ElementsAre; @@ -99,9 +100,10 @@ return &codec_lookup_helper_; } - private: - AutoThread main_thread_; + protected: + test::RunLoop main_thread_; + private: static PeerConnectionFactoryDependencies MakeDependencies() { PeerConnectionFactoryDependencies d; d.network_thread = Thread::Current(); @@ -129,7 +131,6 @@ EXPECT_CALL(*channel1, mid()).WillRepeatedly(ReturnRef(content_name)); EXPECT_CALL(*channel1, SetRtpTransport(_)).WillRepeatedly(Return(true)); - transceiver->SetChannelForTest(std::move(channel1), [&](const std::string& mid) { EXPECT_EQ(mid, content_name); @@ -253,9 +254,6 @@ media_engine()->voice().GetRtpHeaderExtensions(&env().field_trials()), /* on_negotiation_needed= */ [] {}); } - - protected: - AutoThread main_thread_; }; // Basic tests for Stop()