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

Unified Diff: media/test/pipeline_integration_test.cc

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: Added tests to verify no rendering happens for disabled tracks Created 4 years, 6 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
Index: media/test/pipeline_integration_test.cc
diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc
index 1ae0ac8f800aad0933a274de404b0af6b7aaf366..bc200cb08c0c65051ea46c4d39e0851de6f5abab 100644
--- a/media/test/pipeline_integration_test.cc
+++ b/media/test/pipeline_integration_test.cc
@@ -942,6 +942,45 @@ TEST_F(PipelineIntegrationTest, BasicPlaybackHashed) {
EXPECT_TRUE(demuxer_->GetTimelineOffset().is_null());
}
+TEST_F(PipelineIntegrationTest, PlaybackWithAudioTrackDisabled) {
+ ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm", kHashed | kClockless));
+
+ std::vector<MediaTrack::Id> empty;
+ pipeline_->OnEnabledAudioTracksChanged(empty);
+ message_loop_.RunUntilIdle();
+
+ // Seek to flush the pipeline and ensure there's no prerolled audio data.
+ ASSERT_TRUE(Seek(base::TimeDelta::FromSeconds(0)));
+ Play();
+
+ ASSERT_TRUE(WaitUntilOnEnded());
+
+ // Verify that no audio has been rendered, since we disabled audio tracks.
+ EXPECT_HASH_EQ(kNullAudioHash, GetAudioHash());
+}
+
+TEST_F(PipelineIntegrationTest, PlaybackWithVideoTrackDisabled) {
+ ASSERT_EQ(PIPELINE_OK, Start("bear-320x240.webm", kHashed | kClockless));
+
+ std::vector<MediaTrack::Id> empty;
+ pipeline_->OnSelectedVideoTrackChanged(empty);
+ message_loop_.RunUntilIdle();
+
+ // Seek to flush the pipeline and ensure there's no prerolled video data.
+ ASSERT_TRUE(Seek(base::TimeDelta::FromSeconds(0)));
+
+ // Reset the video hash in case some of the prerolled video frames have been
+ // hashed already.
+ ResetVideoHash();
+
+ Play();
+
+ ASSERT_TRUE(WaitUntilOnEnded());
+
+ // Verify that no audio has been rendered, since we disabled audio tracks.
+ EXPECT_HASH_EQ(kNullVideoHash, GetVideoHash());
chcunningham 2016/06/29 22:49:13 These are a great start. Can you add some test for
chcunningham 2016/06/29 22:58:29 Ignore me - I see you did this in your latest PS
servolk 2016/06/29 23:40:13 Yep, added more complete tests in latest PS.
+}
+
TEST_F(PipelineIntegrationTest,
MAYBE_CLOCKLESS(BasicPlaybackOpusOggTrimmingHashed)) {
ASSERT_EQ(PIPELINE_OK,

Powered by Google App Engine
This is Rietveld 408576698