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

Unified Diff: media/filters/video_renderer_base_unittest.cc

Issue 7932005: Reland r101418: Fix aspect ratio and clarify video frame dimensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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/filters/video_renderer_base.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ccef9016c93ec151a5a578148cd5c003ecf22e88..b43c8052e93998e5eac01a14a8a2a4efec4ac201 100644
--- a/media/filters/video_renderer_base_unittest.cc
+++ b/media/filters/video_renderer_base_unittest.cc
@@ -58,8 +58,7 @@ class VideoRendererBaseTest : public ::testing::Test {
EXPECT_CALL(*decoder_, ProduceVideoFrame(_))
.WillRepeatedly(Invoke(this, &VideoRendererBaseTest::EnqueueCallback));
- EXPECT_CALL(*decoder_, width()).WillRepeatedly(Return(kWidth));
- EXPECT_CALL(*decoder_, height()).WillRepeatedly(Return(kHeight));
+ EXPECT_CALL(*decoder_, natural_size()).WillRepeatedly(Return(kNaturalSize));
EXPECT_CALL(stats_callback_object_, OnStatistics(_))
.Times(AnyNumber());
@@ -92,7 +91,7 @@ class VideoRendererBaseTest : public ::testing::Test {
InSequence s;
// We expect the video size to be set.
- EXPECT_CALL(host_, SetVideoSize(kWidth, kHeight));
+ EXPECT_CALL(host_, SetNaturalVideoSize(kNaturalSize));
// Then our subclass will be asked to initialize.
EXPECT_CALL(*renderer_, OnInitialize(_))
@@ -148,7 +147,8 @@ class VideoRendererBaseTest : public ::testing::Test {
void CreateFrame(int64 timestamp, int64 duration) {
const base::TimeDelta kZero;
scoped_refptr<VideoFrame> frame =
- VideoFrame::CreateFrame(VideoFrame::RGB32, kWidth, kHeight,
+ VideoFrame::CreateFrame(VideoFrame::RGB32, kNaturalSize.width(),
+ kNaturalSize.height(),
base::TimeDelta::FromMicroseconds(timestamp),
base::TimeDelta::FromMicroseconds(duration));
decoder_->VideoFrameReadyForTest(frame);
@@ -162,8 +162,7 @@ class VideoRendererBaseTest : public ::testing::Test {
}
protected:
- static const size_t kWidth;
- static const size_t kHeight;
+ static const gfx::Size kNaturalSize;
static const int64 kDuration;
StatisticsCallback* NewStatisticsCallback() {
@@ -196,8 +195,7 @@ class VideoRendererBaseTest : public ::testing::Test {
DISALLOW_COPY_AND_ASSIGN(VideoRendererBaseTest);
};
-const size_t VideoRendererBaseTest::kWidth = 16u;
-const size_t VideoRendererBaseTest::kHeight = 16u;
+const gfx::Size VideoRendererBaseTest::kNaturalSize(16u, 16u);
const int64 VideoRendererBaseTest::kDuration = 10;
// Test initialization where the subclass failed for some reason.
@@ -205,7 +203,7 @@ TEST_F(VideoRendererBaseTest, Initialize_Failed) {
InSequence s;
// We expect the video size to be set.
- EXPECT_CALL(host_, SetVideoSize(kWidth, kHeight));
+ EXPECT_CALL(host_, SetNaturalVideoSize(kNaturalSize));
// Our subclass will fail when asked to initialize.
EXPECT_CALL(*renderer_, OnInitialize(_))
« no previous file with comments | « media/filters/video_renderer_base.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698