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

Unified Diff: talk/media/base/videocapturer_unittest.cc

Issue 1574963002: Deleted renderer-related SetSize methods, and all uses. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/media/base/fakevideorenderer.h ('k') | talk/media/base/videoengine_unittest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bb8eafaca5f411da1111a879222c17c7e47ac4a2 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,10 @@ TEST_F(VideoCapturerTest, ScreencastScaledSuperLarge) {
cricket::FOURCC_ARGB)));
EXPECT_TRUE(capturer_.IsRunning());
EXPECT_EQ(0, renderer_.num_rendered_frames());
- renderer_.SetSize(2050, 1538, 0);
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) {
« no previous file with comments | « talk/media/base/fakevideorenderer.h ('k') | talk/media/base/videoengine_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698