OLD | NEW |
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 "media/filters/pipeline_integration_test_base.h" | 5 #include "media/filters/pipeline_integration_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "media/base/decoder_buffer.h" | 8 #include "media/base/decoder_buffer.h" |
9 #include "media/base/decryptor_client.h" | 9 #include "media/base/decryptor_client.h" |
10 #include "media/base/test_data_util.h" | 10 #include "media/base/test_data_util.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 std::string current_key_system_; | 180 std::string current_key_system_; |
181 std::string current_session_id_; | 181 std::string current_session_id_; |
182 }; | 182 }; |
183 | 183 |
184 class PipelineIntegrationTest | 184 class PipelineIntegrationTest |
185 : public testing::Test, | 185 : public testing::Test, |
186 public PipelineIntegrationTestBase { | 186 public PipelineIntegrationTestBase { |
187 public: | 187 public: |
188 void StartPipelineWithMediaSource(MockMediaSource* source) { | 188 void StartPipelineWithMediaSource(MockMediaSource* source) { |
189 pipeline_->Start( | 189 pipeline_->Start( |
190 CreateFilterCollection(source), | 190 CreateFilterCollection(source, NULL), |
191 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 191 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
192 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), | 192 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), |
193 QuitOnStatusCB(PIPELINE_OK)); | 193 QuitOnStatusCB(PIPELINE_OK)); |
194 | 194 |
195 ASSERT_TRUE(decoder_.get()); | |
196 | |
197 message_loop_.Run(); | 195 message_loop_.Run(); |
198 } | 196 } |
199 | 197 |
200 void StartPipelineWithEncryptedMedia( | 198 void StartPipelineWithEncryptedMedia( |
201 MockMediaSource* source, | 199 MockMediaSource* source, |
202 FakeDecryptorClient* encrypted_media) { | 200 FakeDecryptorClient* encrypted_media) { |
203 pipeline_->Start( | 201 pipeline_->Start( |
204 CreateFilterCollection(source), | 202 CreateFilterCollection(source, encrypted_media->decryptor()), |
205 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 203 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
206 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), | 204 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), |
207 QuitOnStatusCB(PIPELINE_OK)); | 205 QuitOnStatusCB(PIPELINE_OK)); |
208 | 206 |
209 ASSERT_TRUE(decoder_.get()); | |
210 decoder_->set_decryptor(encrypted_media->decryptor()); | |
211 source->set_decryptor_client(encrypted_media); | 207 source->set_decryptor_client(encrypted_media); |
212 | 208 |
213 message_loop_.Run(); | 209 message_loop_.Run(); |
214 } | 210 } |
215 | 211 |
216 // Verifies that seeking works properly for ChunkDemuxer when the | 212 // Verifies that seeking works properly for ChunkDemuxer when the |
217 // seek happens while there is a pending read on the ChunkDemuxer | 213 // seek happens while there is a pending read on the ChunkDemuxer |
218 // and no data is available. | 214 // and no data is available. |
219 bool TestSeekDuringRead(const std::string& filename, | 215 bool TestSeekDuringRead(const std::string& filename, |
220 int initial_append_size, | 216 int initial_append_size, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 357 |
362 // Verify video decoder & renderer can handle aborted demuxer reads. | 358 // Verify video decoder & renderer can handle aborted demuxer reads. |
363 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { | 359 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { |
364 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, | 360 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, |
365 base::TimeDelta::FromMilliseconds(200), | 361 base::TimeDelta::FromMilliseconds(200), |
366 base::TimeDelta::FromMilliseconds(1668), | 362 base::TimeDelta::FromMilliseconds(1668), |
367 0x1C896, 65536, false, true)); | 363 0x1C896, 65536, false, true)); |
368 } | 364 } |
369 | 365 |
370 } // namespace media | 366 } // namespace media |
OLD | NEW |