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

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: Added static cast when converting width and height from size_t to int. 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
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) {

Powered by Google App Engine
This is Rietveld 408576698