Chromium Code Reviews| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 | 181 |
| 182 class PipelineIntegrationTest | 182 class PipelineIntegrationTest |
| 183 : public testing::Test, | 183 : public testing::Test, |
| 184 public PipelineIntegrationTestBase { | 184 public PipelineIntegrationTestBase { |
| 185 public: | 185 public: |
| 186 void StartPipelineWithMediaSource(MockMediaSource* source) { | 186 void StartPipelineWithMediaSource(MockMediaSource* source) { |
| 187 pipeline_->Start( | 187 pipeline_->Start( |
| 188 CreateFilterCollection(source, NULL), | 188 CreateFilterCollection(source, NULL), |
| 189 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 189 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
| 190 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), | 190 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), |
| 191 QuitOnStatusCB(PIPELINE_OK)); | 191 QuitOnStatusCB(PIPELINE_OK), |
| 192 Pipeline::ReadyStateCB()); | |
|
Ami GONE FROM CHROMIUM
2012/08/15 18:00:08
Any reason not to make these actually test that th
acolwell GONE FROM CHROMIUM
2012/08/15 23:21:15
Nope. Done
| |
| 192 | 193 |
| 193 message_loop_.Run(); | 194 message_loop_.Run(); |
| 194 } | 195 } |
| 195 | 196 |
| 196 void StartPipelineWithEncryptedMedia( | 197 void StartPipelineWithEncryptedMedia( |
| 197 MockMediaSource* source, | 198 MockMediaSource* source, |
| 198 FakeDecryptorClient* encrypted_media) { | 199 FakeDecryptorClient* encrypted_media) { |
| 199 pipeline_->Start( | 200 pipeline_->Start( |
| 200 CreateFilterCollection(source, encrypted_media->decryptor()), | 201 CreateFilterCollection(source, encrypted_media->decryptor()), |
| 201 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 202 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
| 202 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), | 203 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), |
| 203 QuitOnStatusCB(PIPELINE_OK)); | 204 QuitOnStatusCB(PIPELINE_OK), |
| 205 Pipeline::ReadyStateCB()); | |
| 204 | 206 |
| 205 source->set_decryptor_client(encrypted_media); | 207 source->set_decryptor_client(encrypted_media); |
| 206 | 208 |
| 207 message_loop_.Run(); | 209 message_loop_.Run(); |
| 208 } | 210 } |
| 209 | 211 |
| 210 // Verifies that seeking works properly for ChunkDemuxer when the | 212 // Verifies that seeking works properly for ChunkDemuxer when the |
| 211 // seek happens while there is a pending read on the ChunkDemuxer | 213 // seek happens while there is a pending read on the ChunkDemuxer |
| 212 // and no data is available. | 214 // and no data is available. |
| 213 bool TestSeekDuringRead(const std::string& filename, | 215 bool TestSeekDuringRead(const std::string& filename, |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 | 355 |
| 354 // Verify video decoder & renderer can handle aborted demuxer reads. | 356 // Verify video decoder & renderer can handle aborted demuxer reads. |
| 355 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { | 357 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { |
| 356 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, | 358 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, |
| 357 base::TimeDelta::FromMilliseconds(200), | 359 base::TimeDelta::FromMilliseconds(200), |
| 358 base::TimeDelta::FromMilliseconds(1668), | 360 base::TimeDelta::FromMilliseconds(1668), |
| 359 0x1C896, 65536, false, true)); | 361 0x1C896, 65536, false, true)); |
| 360 } | 362 } |
| 361 | 363 |
| 362 } // namespace media | 364 } // namespace media |
| OLD | NEW |