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

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

Issue 1526303004: Fix buffered range updates in media::Pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android buildfix Created 4 years, 11 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.cc ('k') | media/filters/chunk_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) 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 "media/base/pipeline.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 654
655 const base::TimeDelta kDuration = base::TimeDelta::FromSeconds(100); 655 const base::TimeDelta kDuration = base::TimeDelta::FromSeconds(100);
656 SetDemuxerExpectations(&streams, kDuration); 656 SetDemuxerExpectations(&streams, kDuration);
657 SetRendererExpectations(); 657 SetRendererExpectations();
658 658
659 StartPipelineAndExpect(PIPELINE_OK); 659 StartPipelineAndExpect(PIPELINE_OK);
660 660
661 EXPECT_EQ(0u, pipeline_->GetBufferedTimeRanges().size()); 661 EXPECT_EQ(0u, pipeline_->GetBufferedTimeRanges().size());
662 662
663 EXPECT_FALSE(pipeline_->DidLoadingProgress()); 663 EXPECT_FALSE(pipeline_->DidLoadingProgress());
664 pipeline_->AddBufferedTimeRange(base::TimeDelta(), kDuration / 8); 664 Ranges<base::TimeDelta> ranges;
665 ranges.Add(base::TimeDelta(), kDuration / 8);
666 pipeline_->OnBufferedTimeRangesChanged(ranges);
665 EXPECT_TRUE(pipeline_->DidLoadingProgress()); 667 EXPECT_TRUE(pipeline_->DidLoadingProgress());
666 EXPECT_FALSE(pipeline_->DidLoadingProgress()); 668 EXPECT_FALSE(pipeline_->DidLoadingProgress());
667 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); 669 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size());
668 EXPECT_EQ(base::TimeDelta(), pipeline_->GetBufferedTimeRanges().start(0)); 670 EXPECT_EQ(base::TimeDelta(), pipeline_->GetBufferedTimeRanges().start(0));
669 EXPECT_EQ(kDuration / 8, pipeline_->GetBufferedTimeRanges().end(0)); 671 EXPECT_EQ(kDuration / 8, pipeline_->GetBufferedTimeRanges().end(0));
670 672
671 base::TimeDelta kSeekTime = kDuration / 2; 673 base::TimeDelta kSeekTime = kDuration / 2;
672 ExpectSeek(kSeekTime, false); 674 ExpectSeek(kSeekTime, false);
673 DoSeek(kSeekTime); 675 DoSeek(kSeekTime);
674 676
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 INSTANTIATE_TEARDOWN_TEST(Error, Seeking); 1157 INSTANTIATE_TEARDOWN_TEST(Error, Seeking);
1156 INSTANTIATE_TEARDOWN_TEST(Error, Playing); 1158 INSTANTIATE_TEARDOWN_TEST(Error, Playing);
1157 INSTANTIATE_TEARDOWN_TEST(Error, Suspending); 1159 INSTANTIATE_TEARDOWN_TEST(Error, Suspending);
1158 INSTANTIATE_TEARDOWN_TEST(Error, Suspended); 1160 INSTANTIATE_TEARDOWN_TEST(Error, Suspended);
1159 INSTANTIATE_TEARDOWN_TEST(Error, Resuming); 1161 INSTANTIATE_TEARDOWN_TEST(Error, Resuming);
1160 1162
1161 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing); 1163 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Playing);
1162 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Suspended); 1164 INSTANTIATE_TEARDOWN_TEST(ErrorAndStop, Suspended);
1163 1165
1164 } // namespace media 1166 } // namespace media
OLDNEW
« no previous file with comments | « media/base/pipeline.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698