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

Unified Diff: media/test/pipeline_integration_test.cc

Issue 2543623003: media: Allow config change between clear and encrypted streams (Closed)
Patch Set: media: Allow config change between clear and encrypted streams 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
Index: media/test/pipeline_integration_test.cc
diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc
index 8e42a038bc7cc45c5b218d0d6cc9da8ebd3bb985..fe1c016400c15b5b9c6c5e6edb0a42a0a184a83e 100644
--- a/media/test/pipeline_integration_test.cc
+++ b/media/test/pipeline_integration_test.cc
@@ -119,7 +119,6 @@ const size_t kAppendWholeFile = std::numeric_limits<size_t>::max();
const int kAppendTimeSec = 1;
const int kAppendTimeMs = kAppendTimeSec * 1000;
const int k320WebMFileDurationMs = 2736;
-const int k320EncWebMFileDurationMs = 2737;
const int k640WebMFileDurationMs = 2749;
const int kOpusEndTrimmingWebMFileDurationMs = 2741;
const int kVP9WebMFileDurationMs = 2736;
@@ -1530,7 +1529,9 @@ TEST_F(PipelineIntegrationTest,
Stop();
}
-// Config changes from encrypted to clear are not currently supported.
+// TODO(xhwang): Config change from clear to encrypted is allowed by the
+// demuxer, but is not currently supported by the Renderer. See
+// http://crbug.com/597443
TEST_F(PipelineIntegrationTest,
MAYBE_EME(MediaSource_ConfigChange_ClearThenEncrypted_WebM)) {
MockMediaSource source("bear-320x240-16x9-aspect.webm", kWebM,
@@ -1542,28 +1543,25 @@ TEST_F(PipelineIntegrationTest,
scoped_refptr<DecoderBuffer> second_file =
ReadTestDataFile("bear-640x360-av_enc-av.webm");
- ASSERT_FALSE(source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
- second_file->data(),
- second_file->data_size()));
-
+ ASSERT_TRUE(source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
ddorwin 2017/02/12 04:28:53 EXPECT_?
xhwang 2017/02/14 23:59:33 Done.
+ second_file->data(),
+ second_file->data_size()));
source.EndOfStream();
- base::RunLoop().Run();
- EXPECT_EQ(CHUNK_DEMUXER_ERROR_APPEND_FAILED, pipeline_status_);
+ Play();
+
+ EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError());
EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
- // The second video was not added, so its time has not been added.
- EXPECT_EQ(k320WebMFileDurationMs,
+ EXPECT_EQ(kAppendTimeMs + k640WebMFileDurationMs,
pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
- Play();
-
- EXPECT_EQ(CHUNK_DEMUXER_ERROR_APPEND_FAILED, WaitUntilEndedOrError());
source.Shutdown();
}
-// Config changes from clear to encrypted are not currently supported.
+// Config change from encrypted to clear is allowed by the demuxer, and is
+// supported by the Renderer.
TEST_F(PipelineIntegrationTest,
MAYBE_EME(MediaSource_ConfigChange_EncryptedThenClear_WebM)) {
MockMediaSource source("bear-320x240-16x9-aspect-av_enc-av.webm", kWebM,
@@ -1572,25 +1570,25 @@ TEST_F(PipelineIntegrationTest,
EXPECT_EQ(PIPELINE_OK,
StartPipelineWithEncryptedMedia(&source, &encrypted_media));
+ EXPECT_CALL(*this, OnVideoNaturalSizeChange(gfx::Size(640, 360))).Times(1);
scoped_refptr<DecoderBuffer> second_file =
ReadTestDataFile("bear-640x360.webm");
- ASSERT_FALSE(source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
- second_file->data(),
- second_file->data_size()));
-
+ ASSERT_TRUE(source.AppendAtTime(base::TimeDelta::FromSeconds(kAppendTimeSec),
+ second_file->data(),
+ second_file->data_size()));
source.EndOfStream();
+ Play();
+ ASSERT_TRUE(WaitUntilOnEnded());
+
EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds());
- // The second video was not added, so its time has not been added.
- EXPECT_EQ(k320EncWebMFileDurationMs,
+ EXPECT_EQ(kAppendTimeMs + k640WebMFileDurationMs,
pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds());
- Play();
-
- EXPECT_EQ(CHUNK_DEMUXER_ERROR_APPEND_FAILED, WaitUntilEndedOrError());
source.Shutdown();
+ Stop();
}
#if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_ANDROID)
« media/filters/decrypting_video_decoder_unittest.cc ('K') | « media/test/data/mse_config_change.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698