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

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

Issue 2085012: Reporting a more accurate buffered time for the video tag (Closed)
Patch Set: Added checks to fix some edgecase bugs. Created 10 years, 6 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/base/pipeline_impl.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <string> 5 #include <string>
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/stl_util-inl.h" 8 #include "base/stl_util-inl.h"
9 #include "base/waitable_event.h" 9 #include "base/waitable_event.h"
10 #include "media/base/pipeline_impl.h" 10 #include "media/base/pipeline_impl.h"
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 InitializeVideoDecoder(video_stream()); 481 InitializeVideoDecoder(video_stream());
482 InitializeVideoRenderer(); 482 InitializeVideoRenderer();
483 483
484 InitializePipeline(); 484 InitializePipeline();
485 EXPECT_TRUE(pipeline_->IsInitialized()); 485 EXPECT_TRUE(pipeline_->IsInitialized());
486 EXPECT_EQ(PIPELINE_OK, pipeline_->GetError()); 486 EXPECT_EQ(PIPELINE_OK, pipeline_->GetError());
487 EXPECT_EQ(kDuration.ToInternalValue(), 487 EXPECT_EQ(kDuration.ToInternalValue(),
488 pipeline_->GetMediaDuration().ToInternalValue()); 488 pipeline_->GetMediaDuration().ToInternalValue());
489 EXPECT_EQ(kTotalBytes, pipeline_->GetTotalBytes()); 489 EXPECT_EQ(kTotalBytes, pipeline_->GetTotalBytes());
490 EXPECT_EQ(kBufferedBytes, pipeline_->GetBufferedBytes()); 490 EXPECT_EQ(kBufferedBytes, pipeline_->GetBufferedBytes());
491 EXPECT_EQ(kDuration.ToInternalValue(), 491 EXPECT_EQ(0,
492 pipeline_->GetBufferedTime().ToInternalValue()); 492 pipeline_->GetBufferedTime().ToInternalValue());
493 } 493 }
494 494
495 TEST_F(PipelineImplTest, DisableAudioRenderer) { 495 TEST_F(PipelineImplTest, DisableAudioRenderer) {
496 CreateAudioStream(); 496 CreateAudioStream();
497 CreateVideoStream(); 497 CreateVideoStream();
498 MockDemuxerStreamVector streams; 498 MockDemuxerStreamVector streams;
499 streams.push_back(audio_stream()); 499 streams.push_back(audio_stream());
500 streams.push_back(video_stream()); 500 streams.push_back(video_stream());
501 501
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 567
568 EXPECT_CALL(*mocks_->audio_renderer(), HasEnded()) 568 EXPECT_CALL(*mocks_->audio_renderer(), HasEnded())
569 .WillOnce(Return(true)); 569 .WillOnce(Return(true));
570 EXPECT_CALL(*mocks_->video_renderer(), HasEnded()) 570 EXPECT_CALL(*mocks_->video_renderer(), HasEnded())
571 .WillOnce(Return(true)); 571 .WillOnce(Return(true));
572 EXPECT_CALL(callbacks_, OnEnded()); 572 EXPECT_CALL(callbacks_, OnEnded());
573 host->NotifyEnded(); 573 host->NotifyEnded();
574 } 574 }
575 575
576 } // namespace media 576 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline_impl.cc ('k') | media/filters/ffmpeg_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698