diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-31 02:05:58 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-31 02:05:58 +0000 |
commit | 6094ed46ebdb978eaafe41bd9611d30b4cd3f812 (patch) | |
tree | 9ec070fe84a66ace9513e8c7379fdfba3b60136a | |
parent | 8d1d1a26aa29eb572a29ed6d5ff131eccdf31d89 (diff) | |
download | chromium_src-6094ed46ebdb978eaafe41bd9611d30b4cd3f812.zip chromium_src-6094ed46ebdb978eaafe41bd9611d30b4cd3f812.tar.gz chromium_src-6094ed46ebdb978eaafe41bd9611d30b4cd3f812.tar.bz2 |
Clean up VideoEncoderVpx tests.
- Rename tests from VideoEncoderVp8Test to VideoEncoderVpxTest.
- Update tests to use CreateTestFrame().
- Update tests to mark whole frame as "updated" for encoding.
Review URL: https://codereview.chromium.org/307963003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273991 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | remoting/codec/video_encoder_vpx_unittest.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/remoting/codec/video_encoder_vpx_unittest.cc b/remoting/codec/video_encoder_vpx_unittest.cc index 5d00106..ccef34c 100644 --- a/remoting/codec/video_encoder_vpx_unittest.cc +++ b/remoting/codec/video_encoder_vpx_unittest.cc @@ -113,35 +113,35 @@ TEST(VideoEncoderVpxTest, TestVp8VideoEncoderIgnoreLossy) { // Test that calling Encode with a differently-sized media::ScreenCaptureData // does not leak memory. -TEST(VideoEncoderVp8Test, TestSizeChangeNoLeak) { - int height = 1000; - int width = 1000; +TEST(VideoEncoderVpxTest, TestSizeChangeNoLeak) { + webrtc::DesktopSize frame_size(1000, 1000); scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8()); - scoped_ptr<webrtc::DesktopFrame> frame( - new webrtc::BasicDesktopFrame(webrtc::DesktopSize(width, height))); - + // Create first frame & encode it. + scoped_ptr<webrtc::DesktopFrame> frame(CreateTestFrame(frame_size)); + frame->mutable_updated_region()->SetRect( + webrtc::DesktopRect::MakeSize(frame_size)); scoped_ptr<VideoPacket> packet = encoder->Encode(*frame); EXPECT_TRUE(packet); - height /= 2; - frame.reset( - new webrtc::BasicDesktopFrame(webrtc::DesktopSize(width, height))); + // Halve the size of the frame, and updated region, and encode again. + frame_size.set(frame_size.width(), frame_size.height() / 2); + frame = CreateTestFrame(frame_size); + frame->mutable_updated_region()->SetRect( + webrtc::DesktopRect::MakeSize(frame_size)); packet = encoder->Encode(*frame); EXPECT_TRUE(packet); } // Test that the DPI information is correctly propagated from the // media::ScreenCaptureData to the VideoPacket. -TEST(VideoEncoderVp8Test, TestDpiPropagation) { - int height = 32; - int width = 32; +TEST(VideoEncoderVpxTest, TestDpiPropagation) { + webrtc::DesktopSize frame_size(32, 32); scoped_ptr<VideoEncoderVpx> encoder(VideoEncoderVpx::CreateForVP8()); - scoped_ptr<webrtc::DesktopFrame> frame( - new webrtc::BasicDesktopFrame(webrtc::DesktopSize(width, height))); + scoped_ptr<webrtc::DesktopFrame> frame(CreateTestFrame(frame_size)); frame->set_dpi(webrtc::DesktopVector(96, 97)); scoped_ptr<VideoPacket> packet = encoder->Encode(*frame); EXPECT_EQ(packet->format().x_dpi(), 96); |