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..ecb17954450c50ad2a71ff600364dac469b5a9b3 100644 |
| --- a/media/filters/pipeline_integration_test_base.cc |
| +++ b/media/filters/pipeline_integration_test_base.cc |
| @@ -59,6 +59,16 @@ 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); |
| + ASSERT_FALSE(need_key_cb_.is_null()); |
|
ddorwin
2013/03/12 04:40:06
Doh, I was wrong. I don't think this failure gets
fgalligan1
2013/03/12 17:20:13
Done.
xhwang
2013/03/12 17:28:57
Is the callback is null, the call (line 69) will s
ddorwin
2013/03/12 19:31:01
Since this is a test, I think we want it to be eas
|
| + need_key_cb_.Run("", "", type, init_data.Pass(), init_data_size); |
| +} |
| + |
| void PipelineIntegrationTestBase::OnEnded() { |
| DCHECK(!ended_); |
| ended_ = true; |
| @@ -94,7 +104,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 +123,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 +201,17 @@ bool PipelineIntegrationTestBase::WaitUntilCurrentTimeIsAfter( |
| scoped_ptr<FilterCollection> |
| PipelineIntegrationTestBase::CreateFilterCollection( |
|
xhwang
2013/03/12 17:28:57
This function really is CreateFilterCollectionWith
|
| - 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); |
|
xhwang
2013/03/12 17:28:57
indentation. "decryptor" should be aligned with "n
fgalligan1
2013/03/13 17:58:09
Done.
|
| } |
| scoped_ptr<FilterCollection> |