Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(958)

Unified Diff: webrtc/api/peerconnectioninterface_unittest.cc

Issue 1836253002: Making new unit test assertions use the standard timeout. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnectioninterface_unittest.cc
diff --git a/webrtc/api/peerconnectioninterface_unittest.cc b/webrtc/api/peerconnectioninterface_unittest.cc
index 544a1430ef09783c3f7c441c192de3e56414fbc1..2c044e20806d1bcf0115f5b263c9640a616e7712 100644
--- a/webrtc/api/peerconnectioninterface_unittest.cc
+++ b/webrtc/api/peerconnectioninterface_unittest.cc
@@ -1868,11 +1868,11 @@ TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) {
scoped_refptr<MediaStreamInterface> remote_stream =
pc_->remote_streams()->at(0);
- EXPECT_EQ(MediaStreamTrackInterface::kEnded,
- remote_stream->GetVideoTracks()[0]->state());
- // Audio source state changes are posted.
+ // Track state may be updated asynchronously.
+ EXPECT_EQ_WAIT(MediaStreamTrackInterface::kEnded,
+ remote_stream->GetAudioTracks()[0]->state(), kTimeout);
EXPECT_EQ_WAIT(MediaStreamTrackInterface::kEnded,
- remote_stream->GetAudioTracks()[0]->state(), 10);
+ remote_stream->GetVideoTracks()[0]->state(), kTimeout);
}
// Test that PeerConnection methods fails gracefully after
@@ -1995,10 +1995,11 @@ TEST_F(PeerConnectionInterfaceTest,
EXPECT_TRUE(DoSetRemoteDescription(desc_ms2.release()));
EXPECT_TRUE(CompareStreamCollections(observer_.remote_streams(),
reference_collection_));
- // Audio source state changes are posted.
+ // Track state may be updated asynchronously.
+ EXPECT_EQ_WAIT(webrtc::MediaStreamTrackInterface::kEnded,
+ audio_track2->state(), kTimeout);
EXPECT_EQ_WAIT(webrtc::MediaStreamTrackInterface::kEnded,
- audio_track2->state(), 1);
- EXPECT_EQ(webrtc::MediaStreamTrackInterface::kEnded, video_track2->state());
+ video_track2->state(), kTimeout);
}
// This tests that remote tracks are ended if a local session description is set
@@ -2043,10 +2044,11 @@ TEST_F(PeerConnectionInterfaceTest, RejectMediaContent) {
ASSERT_TRUE(audio_info != nullptr);
audio_info->rejected = true;
EXPECT_TRUE(DoSetLocalDescription(local_offer.release()));
- EXPECT_EQ(webrtc::MediaStreamTrackInterface::kEnded, remote_video->state());
- // Audio source state changes are posted.
+ // Track state may be updated asynchronously.
+ EXPECT_EQ_WAIT(webrtc::MediaStreamTrackInterface::kEnded,
+ remote_audio->state(), kTimeout);
EXPECT_EQ_WAIT(webrtc::MediaStreamTrackInterface::kEnded,
- remote_audio->state(), 1);
+ remote_video->state(), kTimeout);
}
// This tests that we won't crash if the remote track has been removed outside
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698