Index: talk/media/base/videocapturer_unittest.cc |
diff --git a/talk/media/base/videocapturer_unittest.cc b/talk/media/base/videocapturer_unittest.cc |
index 6d1d8aa3957fad6f067f27fed1449d84ebc91ba8..464afbecd75678321a0daef045a7868a84448a6c 100644 |
--- a/talk/media/base/videocapturer_unittest.cc |
+++ b/talk/media/base/videocapturer_unittest.cc |
@@ -214,9 +214,10 @@ TEST_F(VideoCapturerTest, ScreencastScaledOddWidth) { |
cricket::FOURCC_ARGB))); |
EXPECT_TRUE(capturer_.IsRunning()); |
EXPECT_EQ(0, renderer_.num_rendered_frames()); |
- renderer_.SetSize(kWidth, kHeight, 0); |
EXPECT_TRUE(capturer_.CaptureFrame()); |
EXPECT_EQ(1, renderer_.num_rendered_frames()); |
+ EXPECT_EQ(kWidth, renderer_.width()); |
+ EXPECT_EQ(kHeight, renderer_.height()); |
} |
TEST_F(VideoCapturerTest, TestRotationPending) { |
@@ -244,24 +245,26 @@ TEST_F(VideoCapturerTest, TestRotationPending) { |
// the rotation information, the renderer should be given the right dimension |
// such that the frame could be rendered. |
- // Swap the dimension for the next 2 frames which are rotated by 90 and 270 |
- // degree. |
- renderer_.SetSize(kHeight, kWidth, 0); |
- |
capturer_.SetRotation(webrtc::kVideoRotation_90); |
EXPECT_TRUE(capturer_.CaptureFrame()); |
EXPECT_EQ(++frame_count, renderer_.num_rendered_frames()); |
+ // Swapped width and height |
+ EXPECT_EQ(kWidth, renderer_.height()); |
+ EXPECT_EQ(kHeight, renderer_.width()); |
capturer_.SetRotation(webrtc::kVideoRotation_270); |
EXPECT_TRUE(capturer_.CaptureFrame()); |
EXPECT_EQ(++frame_count, renderer_.num_rendered_frames()); |
- |
- // Reset the renderer to have corresponding width and height. |
- renderer_.SetSize(kWidth, kHeight, 0); |
+ // Swapped width and height |
+ EXPECT_EQ(kWidth, renderer_.height()); |
+ EXPECT_EQ(kHeight, renderer_.width()); |
capturer_.SetRotation(webrtc::kVideoRotation_180); |
EXPECT_TRUE(capturer_.CaptureFrame()); |
EXPECT_EQ(++frame_count, renderer_.num_rendered_frames()); |
+ // Back to normal width and height |
+ EXPECT_EQ(kWidth, renderer_.width()); |
+ EXPECT_EQ(kHeight, renderer_.height()); |
} |
TEST_F(VideoCapturerTest, TestRotationApplied) { |
@@ -286,8 +289,6 @@ TEST_F(VideoCapturerTest, TestRotationApplied) { |
EXPECT_TRUE(capturer_.IsRunning()); |
EXPECT_EQ(0, renderer_.num_rendered_frames()); |
- renderer_.SetSize(kWidth, kHeight, 0); |
- |
// If the frame's rotation is compensated anywhere in the pipeline, the frame |
// won't have its original dimension out from capturer. Since the renderer |
// here has the same dimension as the capturer, it will skip that frame as the |
@@ -331,9 +332,13 @@ TEST_F(VideoCapturerTest, ScreencastScaledSuperLarge) { |
cricket::FOURCC_ARGB))); |
EXPECT_TRUE(capturer_.IsRunning()); |
EXPECT_EQ(0, renderer_.num_rendered_frames()); |
- renderer_.SetSize(2050, 1538, 0); |
+ // TODO(nisse): I'm not entirely sure what's this supposed to test, |
+ // but it seems that the "super large" frame is downscaled by a |
+ // factor of 2. |
pthatcher1
2016/01/11 18:42:08
I think you're right, but I don't think your comme
nisse-webrtc
2016/01/12 08:03:47
Done.
|
EXPECT_TRUE(capturer_.CaptureFrame()); |
EXPECT_EQ(1, renderer_.num_rendered_frames()); |
+ EXPECT_EQ(kWidth / 2, renderer_.width()); |
+ EXPECT_EQ(kHeight / 2, renderer_.height()); |
} |
TEST_F(VideoCapturerTest, TestFourccMatch) { |