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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 MockMediaSource(const std::string& filename, | 474 MockMediaSource(const std::string& filename, |
475 const std::string& mimetype, | 475 const std::string& mimetype, |
476 size_t initial_append_size) | 476 size_t initial_append_size) |
477 : current_position_(0), | 477 : current_position_(0), |
478 initial_append_size_(initial_append_size), | 478 initial_append_size_(initial_append_size), |
479 mimetype_(mimetype), | 479 mimetype_(mimetype), |
480 chunk_demuxer_(new ChunkDemuxer( | 480 chunk_demuxer_(new ChunkDemuxer( |
481 base::Bind(&MockMediaSource::DemuxerOpened, base::Unretained(this)), | 481 base::Bind(&MockMediaSource::DemuxerOpened, base::Unretained(this)), |
482 base::Bind(&MockMediaSource::OnEncryptedMediaInitData, | 482 base::Bind(&MockMediaSource::OnEncryptedMediaInitData, |
483 base::Unretained(this)), | 483 base::Unretained(this)), |
484 scoped_refptr<MediaLog>(new MediaLog()), | 484 scoped_refptr<MediaLog>(new MediaLog()))), |
485 true)), | |
486 owned_chunk_demuxer_(chunk_demuxer_) { | 485 owned_chunk_demuxer_(chunk_demuxer_) { |
487 file_data_ = ReadTestDataFile(filename); | 486 file_data_ = ReadTestDataFile(filename); |
488 | 487 |
489 if (initial_append_size_ == kAppendWholeFile) | 488 if (initial_append_size_ == kAppendWholeFile) |
490 initial_append_size_ = file_data_->data_size(); | 489 initial_append_size_ = file_data_->data_size(); |
491 | 490 |
492 DCHECK_GT(initial_append_size_, 0u); | 491 DCHECK_GT(initial_append_size_, 0u); |
493 DCHECK_LE(initial_append_size_, file_data_->data_size()); | 492 DCHECK_LE(initial_append_size_, file_data_->data_size()); |
494 } | 493 } |
495 | 494 |
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2514 | 2513 |
2515 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2514 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
2516 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2515 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
2517 Play(); | 2516 Play(); |
2518 ASSERT_TRUE(WaitUntilOnEnded()); | 2517 ASSERT_TRUE(WaitUntilOnEnded()); |
2519 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2518 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
2520 demuxer_->GetStartTime()); | 2519 demuxer_->GetStartTime()); |
2521 } | 2520 } |
2522 | 2521 |
2523 } // namespace media | 2522 } // namespace media |
OLD | NEW |