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