| 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/mock_filters.h" | 10 #include "media/base/mock_filters.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK, true)); | 256 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK, true)); |
| 257 | 257 |
| 258 Play(); | 258 Play(); |
| 259 | 259 |
| 260 ASSERT_TRUE(WaitUntilOnEnded()); | 260 ASSERT_TRUE(WaitUntilOnEnded()); |
| 261 | 261 |
| 262 EXPECT_EQ(GetVideoHash(), "f0be120a90a811506777c99a2cdf7cc1"); | 262 EXPECT_EQ(GetVideoHash(), "f0be120a90a811506777c99a2cdf7cc1"); |
| 263 EXPECT_EQ(GetAudioHash(), "6138555be3389e6aba4c8e6f70195d50"); | 263 EXPECT_EQ(GetAudioHash(), "6138555be3389e6aba4c8e6f70195d50"); |
| 264 } | 264 } |
| 265 | 265 |
| 266 TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource) { |
| 267 MockMediaSource source("bear-320x240.webm", 219229, true, true); |
| 268 StartPipelineWithMediaSource(&source); |
| 269 source.EndOfStream(); |
| 270 ASSERT_EQ(pipeline_status_, PIPELINE_OK); |
| 271 |
| 272 EXPECT_EQ(pipeline_->GetBufferedTimeRanges().size(), 1u); |
| 273 EXPECT_EQ(pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds(), 0); |
| 274 EXPECT_EQ(pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds(), 2737); |
| 275 |
| 276 Play(); |
| 277 |
| 278 ASSERT_TRUE(WaitUntilOnEnded()); |
| 279 source.Abort(); |
| 280 Stop(); |
| 281 } |
| 282 |
| 266 TEST_F(PipelineIntegrationTest, EncryptedPlayback) { | 283 TEST_F(PipelineIntegrationTest, EncryptedPlayback) { |
| 267 MockMediaSource source("bear-320x240-encrypted.webm", 219726, true, true); | 284 MockMediaSource source("bear-320x240-encrypted.webm", 219726, true, true); |
| 268 FakeDecryptorClient encrypted_media; | 285 FakeDecryptorClient encrypted_media; |
| 269 StartPipelineWithEncryptedMedia(&source, &encrypted_media); | 286 StartPipelineWithEncryptedMedia(&source, &encrypted_media); |
| 270 | 287 |
| 271 source.EndOfStream(); | 288 source.EndOfStream(); |
| 272 ASSERT_EQ(PIPELINE_OK, pipeline_status_); | 289 ASSERT_EQ(PIPELINE_OK, pipeline_status_); |
| 273 | 290 |
| 274 Play(); | 291 Play(); |
| 275 | 292 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 349 |
| 333 // Verify video decoder & renderer can handle aborted demuxer reads. | 350 // Verify video decoder & renderer can handle aborted demuxer reads. |
| 334 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { | 351 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { |
| 335 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, | 352 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, |
| 336 base::TimeDelta::FromMilliseconds(200), | 353 base::TimeDelta::FromMilliseconds(200), |
| 337 base::TimeDelta::FromMilliseconds(1668), | 354 base::TimeDelta::FromMilliseconds(1668), |
| 338 0x1C896, 65536, false, true)); | 355 0x1C896, 65536, false, true)); |
| 339 } | 356 } |
| 340 | 357 |
| 341 } // namespace media | 358 } // namespace media |
| OLD | NEW |