Index: webrtc/media/engine/webrtcvideoframefactory_unittest.cc |
diff --git a/webrtc/media/engine/webrtcvideoframefactory_unittest.cc b/webrtc/media/engine/webrtcvideoframefactory_unittest.cc |
index 197784b54a3af467f321f792784b8254b38cb4b5..8d650831a018d22c9c5d8155a969822b40ff2f19 100644 |
--- a/webrtc/media/engine/webrtcvideoframefactory_unittest.cc |
+++ b/webrtc/media/engine/webrtcvideoframefactory_unittest.cc |
@@ -92,6 +92,24 @@ class WebRtcVideoFrameFactoryTest : public testing::Test { |
new_height / 2, apply_rotation); |
} |
+ void TestCreateScaledFrame(bool apply_rotation) { |
+ cricket::VideoFrameFactory& factory = factory_; |
+ factory.SetApplyRotation(apply_rotation); |
+ InitFrame(webrtc::kVideoRotation_270); |
+ const cricket::CapturedFrame& captured_frame = get_captured_frame(); |
+ // Create the new frame from the CapturedFrame. |
+ std::unique_ptr<cricket::VideoFrame> frame; |
+ int new_width = captured_frame.width / 2; |
+ int new_height = captured_frame.height / 2; |
+ frame = factory.CreateScaledFrame(&captured_frame, new_width, new_height); |
+ VerifyFrame(frame.get(), webrtc::kVideoRotation_270, new_width, new_height, |
+ apply_rotation); |
+ |
+ frame = factory.CreateScaledFrame(&captured_frame, |
+ new_width / 2, new_height / 2); |
+ VerifyFrame(frame.get(), webrtc::kVideoRotation_270, new_width / 2, |
+ new_height / 2, apply_rotation); |
+ } |
const cricket::CapturedFrame& get_captured_frame() { return captured_frame_; } |
private: |
@@ -100,10 +118,18 @@ class WebRtcVideoFrameFactoryTest : public testing::Test { |
cricket::WebRtcVideoFrameFactory factory_; |
}; |
-TEST_F(WebRtcVideoFrameFactoryTest, NoApplyRotation) { |
+TEST_F(WebRtcVideoFrameFactoryTest, CreateAliasedFrameNoApplyRotation) { |
TestCreateAliasedFrame(false); |
} |
-TEST_F(WebRtcVideoFrameFactoryTest, ApplyRotation) { |
+TEST_F(WebRtcVideoFrameFactoryTest, CreateAliasedFrameApplyRotation) { |
TestCreateAliasedFrame(true); |
} |
+ |
+TEST_F(WebRtcVideoFrameFactoryTest, CreateScaledFrameNoApplyRotation) { |
+ TestCreateScaledFrame(false); |
+} |
+ |
+TEST_F(WebRtcVideoFrameFactoryTest, CreateScaledFrameApplyRotation) { |
+ TestCreateScaledFrame(true); |
+} |