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

Side by Side Diff: media/test/pipeline_integration_test.cc

Issue 2570773002: Fix crash when pipeline is stopped while video restart is pending (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(400))); 1055 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(400)));
1056 ASSERT_TRUE(Suspend()); 1056 ASSERT_TRUE(Suspend());
1057 1057
1058 // Re-enable video track. 1058 // Re-enable video track.
1059 track_ids.push_back("1"); 1059 track_ids.push_back("1");
1060 pipeline_->OnSelectedVideoTrackChanged(track_ids); 1060 pipeline_->OnSelectedVideoTrackChanged(track_ids);
1061 ASSERT_TRUE(Resume(TimestampMs(400))); 1061 ASSERT_TRUE(Resume(TimestampMs(400)));
1062 ASSERT_TRUE(WaitUntilOnEnded()); 1062 ASSERT_TRUE(WaitUntilOnEnded());
1063 } 1063 }
1064 1064
1065 TEST_F(PipelineIntegrationTest, PipelineStoppedWhileAudioRestartPending) {
1066 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm"));
1067 Play();
1068
1069 // Disable audio track first, to re-enable it later and stop the pipeline
1070 // (which destroys the media renderer) while audio restart is pending.
1071 std::vector<MediaTrack::Id> track_ids;
1072 pipeline_->OnEnabledAudioTracksChanged(track_ids);
1073 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(200)));
1074
1075 track_ids.push_back("2");
1076 pipeline_->OnEnabledAudioTracksChanged(track_ids);
1077 Stop();
1078 }
1079
1080 TEST_F(PipelineIntegrationTest, PipelineStoppedWhileVideoRestartPending) {
1081 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm"));
1082 Play();
1083
1084 // Disable video track first, to re-enable it later and stop the pipeline
1085 // (which destroys the media renderer) while video restart is pending.
1086 std::vector<MediaTrack::Id> track_ids;
1087 pipeline_->OnSelectedVideoTrackChanged(track_ids);
1088 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(200)));
1089
1090 track_ids.push_back("1");
1091 pipeline_->OnSelectedVideoTrackChanged(track_ids);
1092 Stop();
1093 }
1094
1065 TEST_F(PipelineIntegrationTest, 1095 TEST_F(PipelineIntegrationTest,
1066 MAYBE_CLOCKLESS(BasicPlaybackOpusOggTrimmingHashed)) { 1096 MAYBE_CLOCKLESS(BasicPlaybackOpusOggTrimmingHashed)) {
1067 ASSERT_EQ(PIPELINE_OK, 1097 ASSERT_EQ(PIPELINE_OK,
1068 Start("opus-trimming-test.webm", kHashed | kClockless)); 1098 Start("opus-trimming-test.webm", kHashed | kClockless));
1069 1099
1070 Play(); 1100 Play();
1071 1101
1072 ASSERT_TRUE(WaitUntilOnEnded()); 1102 ASSERT_TRUE(WaitUntilOnEnded());
1073 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash()); 1103 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash());
1074 1104
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
2549 2579
2550 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 2580 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
2551 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 2581 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
2552 Play(); 2582 Play();
2553 ASSERT_TRUE(WaitUntilOnEnded()); 2583 ASSERT_TRUE(WaitUntilOnEnded());
2554 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 2584 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
2555 demuxer_->GetStartTime()); 2585 demuxer_->GetStartTime());
2556 } 2586 }
2557 2587
2558 } // namespace media 2588 } // namespace media
OLDNEW
« 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