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

Unified Diff: media/base/pipeline_impl_unittest.cc

Issue 165180: Merge 22087 - Missing buffered attribute for <video>/<audio>... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/pipeline_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl_unittest.cc
===================================================================
--- media/base/pipeline_impl_unittest.cc (revision 22821)
+++ media/base/pipeline_impl_unittest.cc (working copy)
@@ -20,6 +20,16 @@
using ::testing::Return;
using ::testing::StrictMock;
+namespace {
+
+// Total bytes of the data source.
+const int kTotalBytes = 1024;
+
+// Buffered bytes of the data source.
+const int kBufferedBytes = 1024;
+
+} // namespace
+
namespace media {
// Used for setting expectations on pipeline callbacks. Using a StrictMock
@@ -70,7 +80,9 @@
// Sets up expectations to allow the data source to initialize.
void InitializeDataSource() {
EXPECT_CALL(*mocks_->data_source(), Initialize("", NotNull()))
- .WillOnce(Invoke(&RunFilterCallback));
+ .WillOnce(DoAll(SetTotalBytes(mocks_->data_source(), kTotalBytes),
+ SetBufferedBytes(mocks_->data_source(), kBufferedBytes),
+ Invoke(&RunFilterCallback)));
EXPECT_CALL(*mocks_->data_source(), SetPlaybackRate(0.0f));
EXPECT_CALL(*mocks_->data_source(), Seek(base::TimeDelta(), NotNull()))
.WillOnce(Invoke(&RunFilterCallback));
@@ -404,4 +416,27 @@
pipeline_->SetVolume(expected);
}
+TEST_F(PipelineImplTest, Properties) {
+ scoped_refptr<StrictMock<MockDemuxerStream> > stream =
+ new StrictMock<MockDemuxerStream>("video/x-foo");
+ MockDemuxerStreamVector streams;
+ streams.push_back(stream);
+
+ InitializeDataSource();
+ base::TimeDelta kDuration = base::TimeDelta::FromSeconds(100);
+ InitializeDemuxer(&streams, kDuration);
+ InitializeVideoDecoder(stream);
+ InitializeVideoRenderer();
+
+ InitializePipeline();
+ EXPECT_TRUE(pipeline_->IsInitialized());
+ EXPECT_EQ(PIPELINE_OK, pipeline_->GetError());
+ EXPECT_EQ(kDuration.ToInternalValue(),
+ pipeline_->GetDuration().ToInternalValue());
+ EXPECT_EQ(kTotalBytes, pipeline_->GetTotalBytes());
+ EXPECT_EQ(kBufferedBytes, pipeline_->GetBufferedBytes());
+ EXPECT_EQ(kDuration.ToInternalValue(),
+ pipeline_->GetBufferedTime().ToInternalValue());
+}
+
} // namespace media
Property changes on: media\base\pipeline_impl_unittest.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/media/base/pipeline_impl_unittest.cc:r22087
« no previous file with comments | « media/base/pipeline_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698