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

Unified Diff: media/test/pipeline_integration_test.cc

Issue 2570773002: Fix crash when pipeline is stopped while video restart is pending (Closed)
Patch Set: Added comments + addressed CR feedback Created 4 years 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
« media/renderers/renderer_impl.cc ('K') | « media/renderers/renderer_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/test/pipeline_integration_test.cc
diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc
index cc1295872345efa77cfd4e274b2ddd8aa77a8b13..c06037618433ede1401362f0e9e67c3ce8de40a5 100644
--- a/media/test/pipeline_integration_test.cc
+++ b/media/test/pipeline_integration_test.cc
@@ -1062,6 +1062,36 @@ TEST_F(PipelineIntegrationTest, TrackStatusChangesWhileSuspended) {
ASSERT_TRUE(WaitUntilOnEnded());
}
+TEST_F(PipelineIntegrationTest, PipelineStoppedWhileAudioRestartPending) {
+ ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm"));
+ Play();
+
+ // Disable audio track first, to re-enable it later and stop the pipeline
+ // (which destroys the media renderer) while audio restart is pending.
+ std::vector<MediaTrack::Id> track_ids;
+ pipeline_->OnEnabledAudioTracksChanged(track_ids);
+ ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(200)));
+
+ track_ids.push_back("2");
+ pipeline_->OnEnabledAudioTracksChanged(track_ids);
+ Stop();
+}
+
+TEST_F(PipelineIntegrationTest, PipelineStoppedWhileVideoRestartPending) {
+ ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm"));
+ Play();
+
+ // Disable video track first, to re-enable it later and stop the pipeline
+ // (which destroys the media renderer) while video restart is pending.
+ std::vector<MediaTrack::Id> track_ids;
+ pipeline_->OnSelectedVideoTrackChanged(track_ids);
+ ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(200)));
+
+ track_ids.push_back("1");
+ pipeline_->OnSelectedVideoTrackChanged(track_ids);
+ Stop();
+}
+
TEST_F(PipelineIntegrationTest,
MAYBE_CLOCKLESS(BasicPlaybackOpusOggTrimmingHashed)) {
ASSERT_EQ(PIPELINE_OK,
« media/renderers/renderer_impl.cc ('K') | « media/renderers/renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698