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

Side by Side Diff: media/base/pipeline_unittest.cc

Issue 236023003: Add WebMediaPlayer::timelineOffset() support to WebMediaPlayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « media/base/pipeline.cc ('k') | media/base/stream_parser.h » ('j') | 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 <vector> 5 #include <vector>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/test/simple_test_tick_clock.h" 10 #include "base/test/simple_test_tick_clock.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 filter_collection_->SetTextRenderer(text_renderer.Pass()); 101 filter_collection_->SetTextRenderer(text_renderer.Pass());
102 102
103 // InitializeDemuxer() adds overriding expectations for expected non-NULL 103 // InitializeDemuxer() adds overriding expectations for expected non-NULL
104 // streams. 104 // streams.
105 DemuxerStream* null_pointer = NULL; 105 DemuxerStream* null_pointer = NULL;
106 EXPECT_CALL(*demuxer_, GetStream(_)) 106 EXPECT_CALL(*demuxer_, GetStream(_))
107 .WillRepeatedly(Return(null_pointer)); 107 .WillRepeatedly(Return(null_pointer));
108 108
109 EXPECT_CALL(*demuxer_, GetStartTime()) 109 EXPECT_CALL(*demuxer_, GetStartTime())
110 .WillRepeatedly(Return(base::TimeDelta())); 110 .WillRepeatedly(Return(base::TimeDelta()));
111
112 EXPECT_CALL(*demuxer_, GetTimelineOffset())
113 .WillRepeatedly(Return(base::Time()));
111 } 114 }
112 115
113 virtual ~PipelineTest() { 116 virtual ~PipelineTest() {
114 if (!pipeline_ || !pipeline_->IsRunning()) 117 if (!pipeline_ || !pipeline_->IsRunning())
115 return; 118 return;
116 119
117 ExpectStop(); 120 ExpectStop();
118 121
119 // The mock demuxer doesn't stop the fake text track stream, 122 // The mock demuxer doesn't stop the fake text track stream,
120 // so just stop it manually. 123 // so just stop it manually.
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 655
653 TEST_F(PipelineTest, AudioStreamShorterThanVideo) { 656 TEST_F(PipelineTest, AudioStreamShorterThanVideo) {
654 base::TimeDelta duration = base::TimeDelta::FromSeconds(10); 657 base::TimeDelta duration = base::TimeDelta::FromSeconds(10);
655 658
656 CreateAudioStream(); 659 CreateAudioStream();
657 CreateVideoStream(); 660 CreateVideoStream();
658 MockDemuxerStreamVector streams; 661 MockDemuxerStreamVector streams;
659 streams.push_back(audio_stream()); 662 streams.push_back(audio_stream());
660 streams.push_back(video_stream()); 663 streams.push_back(video_stream());
661 664
662 // Replace the clock so we can simulate wallclock time advancing w/o using 665 // Replace the clock so we can simulate wall clock time advancing w/o using
663 // Sleep(). 666 // Sleep().
664 pipeline_->SetClockForTesting(new Clock(&test_tick_clock_)); 667 pipeline_->SetClockForTesting(new Clock(&test_tick_clock_));
665 668
666 InitializeDemuxer(&streams, duration); 669 InitializeDemuxer(&streams, duration);
667 InitializeAudioRenderer(audio_stream(), false); 670 InitializeAudioRenderer(audio_stream(), false);
668 InitializeVideoRenderer(video_stream()); 671 InitializeVideoRenderer(video_stream());
669 InitializePipeline(PIPELINE_OK); 672 InitializePipeline(PIPELINE_OK);
670 673
671 EXPECT_EQ(0, pipeline_->GetMediaTime().ToInternalValue()); 674 EXPECT_EQ(0, pipeline_->GetMediaTime().ToInternalValue());
672 675
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 INSTANTIATE_TEARDOWN_TEST(Error, Pausing); 1237 INSTANTIATE_TEARDOWN_TEST(Error, Pausing);
1235 INSTANTIATE_TEARDOWN_TEST(Error, Flushing); 1238 INSTANTIATE_TEARDOWN_TEST(Error, Flushing);
1236 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); 1239 INSTANTIATE_TEARDOWN_TEST(Error, Seeking);
1237 INSTANTIATE_TEARDOWN_TEST(Error, Prerolling); 1240 INSTANTIATE_TEARDOWN_TEST(Error, Prerolling);
1238 INSTANTIATE_TEARDOWN_TEST(Error, Starting); 1241 INSTANTIATE_TEARDOWN_TEST(Error, Starting);
1239 INSTANTIATE_TEARDOWN_TEST(Error, Playing); 1242 INSTANTIATE_TEARDOWN_TEST(Error, Playing);
1240 1243
1241 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); 1244 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing);
1242 1245
1243 } // namespace media 1246 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline.cc ('k') | media/base/stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698