Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: media/test/pipeline_integration_test.cc

Issue 1312763014: Rename WebSourceBuffer::abort -> resetParserState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 scoped_ptr<Demuxer> GetDemuxer() { return owned_chunk_demuxer_.Pass(); } 491 scoped_ptr<Demuxer> GetDemuxer() { return owned_chunk_demuxer_.Pass(); }
492 492
493 void set_encrypted_media_init_data_cb( 493 void set_encrypted_media_init_data_cb(
494 const Demuxer::EncryptedMediaInitDataCB& encrypted_media_init_data_cb) { 494 const Demuxer::EncryptedMediaInitDataCB& encrypted_media_init_data_cb) {
495 encrypted_media_init_data_cb_ = encrypted_media_init_data_cb; 495 encrypted_media_init_data_cb_ = encrypted_media_init_data_cb;
496 } 496 }
497 497
498 void Seek(base::TimeDelta seek_time, int new_position, int seek_append_size) { 498 void Seek(base::TimeDelta seek_time, int new_position, int seek_append_size) {
499 chunk_demuxer_->StartWaitingForSeek(seek_time); 499 chunk_demuxer_->StartWaitingForSeek(seek_time);
500 500
501 chunk_demuxer_->Abort( 501 chunk_demuxer_->ResetParserState(
502 kSourceId, 502 kSourceId,
503 base::TimeDelta(), kInfiniteDuration(), &last_timestamp_offset_); 503 base::TimeDelta(), kInfiniteDuration(), &last_timestamp_offset_);
504 504
505 DCHECK_GE(new_position, 0); 505 DCHECK_GE(new_position, 0);
506 DCHECK_LT(new_position, file_data_->data_size()); 506 DCHECK_LT(new_position, file_data_->data_size());
507 current_position_ = new_position; 507 current_position_ = new_position;
508 508
509 AppendData(seek_append_size); 509 AppendData(seek_append_size);
510 } 510 }
511 511
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 &timestamp_offset, 552 &timestamp_offset,
553 base::Bind(&MockMediaSource::InitSegmentReceived, 553 base::Bind(&MockMediaSource::InitSegmentReceived,
554 base::Unretained(this))); 554 base::Unretained(this)));
555 last_timestamp_offset_ = timestamp_offset; 555 last_timestamp_offset_ = timestamp_offset;
556 } 556 }
557 557
558 void EndOfStream() { 558 void EndOfStream() {
559 chunk_demuxer_->MarkEndOfStream(PIPELINE_OK); 559 chunk_demuxer_->MarkEndOfStream(PIPELINE_OK);
560 } 560 }
561 561
562 void Abort() { 562 void Abort() {
wolenetz 2015/09/09 18:20:42 Hmm. This mock of the SourceBuffer API's Abort() d
563 if (!chunk_demuxer_) 563 if (!chunk_demuxer_)
564 return; 564 return;
565 chunk_demuxer_->Shutdown(); 565 chunk_demuxer_->Shutdown();
566 chunk_demuxer_ = NULL; 566 chunk_demuxer_ = NULL;
567 } 567 }
568 568
569 void DemuxerOpened() { 569 void DemuxerOpened() {
570 base::MessageLoop::current()->PostTask( 570 base::MessageLoop::current()->PostTask(
571 FROM_HERE, base::Bind(&MockMediaSource::DemuxerOpenedTask, 571 FROM_HERE, base::Bind(&MockMediaSource::DemuxerOpenedTask,
572 base::Unretained(this))); 572 base::Unretained(this)));
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1836 1836
1837 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { 1837 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) {
1838 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); 1838 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm"));
1839 Play(); 1839 Play();
1840 ASSERT_TRUE(WaitUntilOnEnded()); 1840 ASSERT_TRUE(WaitUntilOnEnded());
1841 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), 1841 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000),
1842 demuxer_->GetStartTime()); 1842 demuxer_->GetStartTime());
1843 } 1843 }
1844 1844
1845 } // namespace media 1845 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698