Chromium Code Reviews| Index: media/filters/pipeline_integration_test_base.cc |
| diff --git a/media/filters/pipeline_integration_test_base.cc b/media/filters/pipeline_integration_test_base.cc |
| index c43cc9296c83c1beacd5094b5b31591041aae55d..a0ade5ab10c2c68b61437d4a2d37911bff6b3f08 100644 |
| --- a/media/filters/pipeline_integration_test_base.cc |
| +++ b/media/filters/pipeline_integration_test_base.cc |
| @@ -59,6 +59,15 @@ PipelineStatusCB PipelineIntegrationTestBase::QuitOnStatusCB( |
| expected_status); |
| } |
| +void PipelineIntegrationTestBase::DemuxerNeedKeyCB( |
| + const std::string& type, |
| + scoped_array<uint8> init_data, |
| + int init_data_size) { |
| + DCHECK(init_data.get()); |
| + DCHECK_GT(init_data_size, 0); |
| + need_key_cb_.Run("", "", type, init_data.Pass(), init_data_size); |
|
ddorwin
2013/03/10 21:29:39
ASSERT_TRUE(need_key_cb_);
It's a test failure if
fgalligan1
2013/03/12 00:42:42
Done. I also added to the media source test too.
|
| +} |
| + |
| void PipelineIntegrationTestBase::OnEnded() { |
| DCHECK(!ended_); |
| ended_ = true; |
| @@ -94,7 +103,7 @@ bool PipelineIntegrationTestBase::Start(const base::FilePath& file_path, |
| EXPECT_CALL(*this, OnBufferingState(Pipeline::kPrerollCompleted)) |
| .Times(AtMost(1)); |
| pipeline_->Start( |
| - CreateFilterCollection(file_path), |
| + CreateFilterCollection(file_path, NULL), |
| base::Bind(&PipelineIntegrationTestBase::OnEnded, base::Unretained(this)), |
| base::Bind(&PipelineIntegrationTestBase::OnError, base::Unretained(this)), |
| QuitOnStatusCB(expected_status), |
| @@ -113,12 +122,17 @@ bool PipelineIntegrationTestBase::Start(const base::FilePath& file_path, |
| } |
| bool PipelineIntegrationTestBase::Start(const base::FilePath& file_path) { |
| + return Start(file_path, NULL); |
| +} |
| + |
| +bool PipelineIntegrationTestBase::Start(const base::FilePath& file_path, |
| + Decryptor* decryptor) { |
| EXPECT_CALL(*this, OnBufferingState(Pipeline::kHaveMetadata)) |
| .Times(AtMost(1)); |
| EXPECT_CALL(*this, OnBufferingState(Pipeline::kPrerollCompleted)) |
| .Times(AtMost(1)); |
| pipeline_->Start( |
| - CreateFilterCollection(file_path), |
| + CreateFilterCollection(file_path, decryptor), |
| base::Bind(&PipelineIntegrationTestBase::OnEnded, base::Unretained(this)), |
| base::Bind(&PipelineIntegrationTestBase::OnError, base::Unretained(this)), |
| base::Bind(&PipelineIntegrationTestBase::OnStatusCallback, |
| @@ -186,12 +200,17 @@ bool PipelineIntegrationTestBase::WaitUntilCurrentTimeIsAfter( |
| scoped_ptr<FilterCollection> |
| PipelineIntegrationTestBase::CreateFilterCollection( |
| - const base::FilePath& file_path) { |
| + const base::FilePath& file_path, |
| + Decryptor* decryptor) { |
| scoped_refptr<FileDataSource> data_source = new FileDataSource(); |
| CHECK(data_source->Initialize(file_path)); |
| + media::FFmpegNeedKeyCB need_key_cb = |
| + base::Bind(&PipelineIntegrationTestBase::DemuxerNeedKeyCB, |
| + base::Unretained(this)); |
| return CreateFilterCollection( |
| - new FFmpegDemuxer(message_loop_.message_loop_proxy(), data_source), |
| - NULL); |
| + new FFmpegDemuxer(message_loop_.message_loop_proxy(), |
| + data_source, |
| + need_key_cb), decryptor); |
| } |
| scoped_ptr<FilterCollection> |