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

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: 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 unified diff | Download patch
« no previous file with comments | « media/renderers/renderer_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(400))); 1058 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(400)));
1059 ASSERT_TRUE(Suspend()); 1059 ASSERT_TRUE(Suspend());
1060 1060
1061 // Re-enable video track. 1061 // Re-enable video track.
1062 track_ids.push_back("1"); 1062 track_ids.push_back("1");
1063 pipeline_->OnSelectedVideoTrackChanged(track_ids); 1063 pipeline_->OnSelectedVideoTrackChanged(track_ids);
1064 ASSERT_TRUE(Resume(TimestampMs(400))); 1064 ASSERT_TRUE(Resume(TimestampMs(400)));
1065 ASSERT_TRUE(WaitUntilOnEnded()); 1065 ASSERT_TRUE(WaitUntilOnEnded());
1066 } 1066 }
1067 1067
1068 TEST_F(PipelineIntegrationTest, PipelineStoppedWhileAudioRestartPending) {
1069 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm"));
1070 Play();
1071
1072 // Disable audio track first, to re-enable it later and stop the pipeline
1073 // (which destroys the media renderer) while audio restart is pending.
1074 std::vector<MediaTrack::Id> track_ids;
1075 pipeline_->OnEnabledAudioTracksChanged(track_ids);
1076 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(200)));
1077
1078 track_ids.push_back("2");
1079 pipeline_->OnEnabledAudioTracksChanged(track_ids);
1080 Stop();
1081 }
1082
1083 TEST_F(PipelineIntegrationTest, PipelineStoppedWhileVideoRestartPending) {
1084 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm"));
1085 Play();
1086
1087 // Disable video track first, to re-enable it later and stop the pipeline
1088 // (which destroys the media renderer) while video restart is pending.
1089 std::vector<MediaTrack::Id> track_ids;
1090 pipeline_->OnSelectedVideoTrackChanged(track_ids);
1091 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(TimestampMs(200)));
1092
1093 track_ids.push_back("1");
1094 pipeline_->OnSelectedVideoTrackChanged(track_ids);
1095 Stop();
1096 }
1097
1068 TEST_F(PipelineIntegrationTest, 1098 TEST_F(PipelineIntegrationTest,
1069 MAYBE_CLOCKLESS(BasicPlaybackOpusOggTrimmingHashed)) { 1099 MAYBE_CLOCKLESS(BasicPlaybackOpusOggTrimmingHashed)) {
1070 ASSERT_EQ(PIPELINE_OK, 1100 ASSERT_EQ(PIPELINE_OK,
1071 Start("opus-trimming-test.webm", kHashed | kClockless)); 1101 Start("opus-trimming-test.webm", kHashed | kClockless));
1072 1102
1073 Play(); 1103 Play();
1074 1104
1075 ASSERT_TRUE(WaitUntilOnEnded()); 1105 ASSERT_TRUE(WaitUntilOnEnded());
1076 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash()); 1106 EXPECT_HASH_EQ(kOpusEndTrimmingHash_1, GetAudioHash());
1077 1107
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
2552 2582
2553 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 2583 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
2554 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 2584 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
2555 Play(); 2585 Play();
2556 ASSERT_TRUE(WaitUntilOnEnded()); 2586 ASSERT_TRUE(WaitUntilOnEnded());
2557 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 2587 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
2558 demuxer_->GetStartTime()); 2588 demuxer_->GetStartTime());
2559 } 2589 }
2560 2590
2561 } // namespace media 2591 } // namespace media
OLDNEW
« 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