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

Unified Diff: media/test/pipeline_integration_test.cc

Issue 2570773002: Fix crash when pipeline is stopped while video restart is pending (Closed)
Patch Set: Invalidate weak RendererImpl pointers, instead of introducing a new renderer state Created 3 years, 11 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 | « 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 652398f9781fb692cf39a1d274c0e99684a9ec0d..8e42a038bc7cc45c5b218d0d6cc9da8ebd3bb985 100644
--- a/media/test/pipeline_integration_test.cc
+++ b/media/test/pipeline_integration_test.cc
@@ -1065,6 +1065,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,
« no previous file with comments | « media/renderers/renderer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698