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

Unified Diff: media/filters/video_renderer_base_unittest.cc

Issue 7461016: Replace VideoDecoder::media_format() with significantly simpler width()/height() methods. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 9 years, 5 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
Index: media/filters/video_renderer_base_unittest.cc
diff --git a/media/filters/video_renderer_base_unittest.cc b/media/filters/video_renderer_base_unittest.cc
index 8fdf1e3b398d31decc163264ecc1ac5b7af0370c..ad29a82bb656bfacb1f3562e75c9007ef43e8515 100644
--- a/media/filters/video_renderer_base_unittest.cc
+++ b/media/filters/video_renderer_base_unittest.cc
@@ -58,15 +58,14 @@ class VideoRendererBaseTest : public ::testing::Test {
EXPECT_CALL(*decoder_, ProduceVideoFrame(_))
.WillRepeatedly(Invoke(this, &VideoRendererBaseTest::EnqueueCallback));
- // Sets the essential media format keys for this decoder.
- decoder_media_format_.SetAsInteger(MediaFormat::kSurfaceFormat,
- VideoFrame::YV12);
- decoder_media_format_.SetAsInteger(MediaFormat::kWidth, kWidth);
- decoder_media_format_.SetAsInteger(MediaFormat::kHeight, kHeight);
- EXPECT_CALL(*decoder_, media_format())
- .WillRepeatedly(ReturnRef(decoder_media_format_));
EXPECT_CALL(*decoder_, ProvidesBuffer())
.WillRepeatedly(Return(true));
+
+ EXPECT_CALL(*decoder_, width())
Ami GONE FROM CHROMIUM 2011/07/20 16:30:22 FWIW these look like they'll fit in 80-cols.
scherkus (not reviewing) 2011/07/20 16:51:52 Done.
+ .WillRepeatedly(Return(kWidth));
+ EXPECT_CALL(*decoder_, height())
+ .WillRepeatedly(Return(kHeight));
+
EXPECT_CALL(stats_callback_object_, OnStatistics(_))
.Times(AnyNumber());
}
@@ -181,7 +180,6 @@ class VideoRendererBaseTest : public ::testing::Test {
scoped_refptr<MockVideoRendererBase> renderer_;
scoped_refptr<MockVideoDecoder> decoder_;
StrictMock<MockFilterHost> host_;
- MediaFormat decoder_media_format_;
MockStatisticsCallback stats_callback_object_;
// Receives all the buffers that renderer had provided to |decoder_|.
@@ -207,28 +205,6 @@ const size_t VideoRendererBaseTest::kWidth = 16u;
const size_t VideoRendererBaseTest::kHeight = 16u;
const int64 VideoRendererBaseTest::kDuration = 10;
-// Test initialization where the decoder's media format is malformed.
-TEST_F(VideoRendererBaseTest, Initialize_BadMediaFormat) {
- // Don't set a media format.
- MediaFormat media_format;
- scoped_refptr<MockVideoDecoder> bad_decoder(new MockVideoDecoder());
- EXPECT_CALL(*bad_decoder, ProvidesBuffer())
- .WillRepeatedly(Return(true));
-
- InSequence s;
-
- EXPECT_CALL(*bad_decoder, media_format())
- .WillRepeatedly(ReturnRef(media_format));
-
- // We expect to receive an error.
- EXPECT_CALL(host_, SetError(PIPELINE_ERROR_INITIALIZATION_FAILED));
-
- // Initialize, we expect to have no reads.
- renderer_->Initialize(bad_decoder,
- NewExpectedCallback(), NewStatisticsCallback());
- EXPECT_EQ(0u, read_queue_.size());
-}
-
// Test initialization where the subclass failed for some reason.
TEST_F(VideoRendererBaseTest, Initialize_Failed) {
InSequence s;

Powered by Google App Engine
This is Rietveld 408576698