Chromium Code Reviews| Index: talk/media/base/videocapturer_unittest.cc |
| diff --git a/talk/media/base/videocapturer_unittest.cc b/talk/media/base/videocapturer_unittest.cc |
| index bb8eafaca5f411da1111a879222c17c7e47ac4a2..4a5f778cf0bf0b0ff1917e514f1fc10c983e04e4 100644 |
| --- a/talk/media/base/videocapturer_unittest.cc |
| +++ b/talk/media/base/videocapturer_unittest.cc |
| @@ -56,24 +56,30 @@ class VideoCapturerTest |
| num_state_changes_(0), |
| video_frames_received_(0), |
| expects_rotation_applied_(true) { |
| - capturer_.SignalVideoFrame.connect(this, &VideoCapturerTest::OnVideoFrame); |
| + renderer_.SignalRenderFrame.connect(this, &VideoCapturerTest::OnVideoFrame); |
| capturer_.SignalStateChange.connect(this, |
| &VideoCapturerTest::OnStateChange); |
| + rtc::VideoSinkCapabilities sink_capabilities; |
| + sink_capabilities.can_apply_rotation = !expects_rotation_applied_; |
|
nisse-webrtc
2016/02/03 09:16:34
Is it possible to name these flags in some differe
perkj_webrtc
2016/02/08 14:32:00
ptal
|
| + capturer_.AddSink(&renderer_, sink_capabilities); |
| } |
| void set_expected_compensation(bool compensation) { |
| expects_rotation_applied_ = compensation; |
| + capturer_.RemoveSink(&renderer_); |
| + rtc::VideoSinkCapabilities sink_capabilities; |
| + sink_capabilities.can_apply_rotation = !expects_rotation_applied_; |
| + capturer_.AddSink(&renderer_, sink_capabilities); |
| } |
| protected: |
| - void OnVideoFrame(cricket::VideoCapturer*, const cricket::VideoFrame* frame) { |
| + void OnVideoFrame(const cricket::VideoFrame* frame) { |
| ++video_frames_received_; |
| if (expects_rotation_applied_) { |
| EXPECT_EQ(webrtc::kVideoRotation_0, frame->GetRotation()); |
| } else { |
| EXPECT_EQ(capturer_.GetRotation(), frame->GetRotation()); |
| } |
| - renderer_.RenderFrame(frame); |
| } |
| void OnStateChange(cricket::VideoCapturer*, |
| cricket::CaptureState capture_state) { |
| @@ -278,9 +284,8 @@ TEST_F(VideoCapturerTest, TestRotationApplied) { |
| capturer_.ResetSupportedFormats(formats); |
| // capturer_ should not compensate rotation. |
| - capturer_.SetApplyRotation(false); |
| - capturer_.UpdateAspectRatio(400, 200); |
| set_expected_compensation(false); |
| + capturer_.UpdateAspectRatio(400, 200); |
| EXPECT_EQ(cricket::CS_RUNNING, |
| capturer_.Start(cricket::VideoFormat( |