From 8b6d3d07dc51f52f3079f300262c4e3c58645ee5 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Fri, 13 Sep 2013 22:43:41 +0000 Subject: Simplify VideoEncoder interface. This should also avoid assert in the linked bug. BUG=284775 R=wez@chromium.org Review URL: https://codereview.chromium.org/23477059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223152 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/video_scheduler_unittest.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'remoting/host/video_scheduler_unittest.cc') diff --git a/remoting/host/video_scheduler_unittest.cc b/remoting/host/video_scheduler_unittest.cc index 2dd7afb..25567d2 100644 --- a/remoting/host/video_scheduler_unittest.cc +++ b/remoting/host/video_scheduler_unittest.cc @@ -37,8 +37,7 @@ namespace { ACTION(FinishEncode) { scoped_ptr packet(new VideoPacket()); - packet->set_flags(VideoPacket::LAST_PACKET | VideoPacket::LAST_PARTITION); - arg1.Run(packet.Pass()); + return packet.release(); } ACTION(FinishSend) { @@ -55,9 +54,11 @@ class MockVideoEncoder : public VideoEncoder { MockVideoEncoder(); virtual ~MockVideoEncoder(); - MOCK_METHOD2(Encode, void( - const webrtc::DesktopFrame* frame, - const DataAvailableCallback& data_available_callback)); + scoped_ptr Encode( + const webrtc::DesktopFrame& frame) { + return scoped_ptr(EncodePtr(frame)); + } + MOCK_METHOD1(EncodePtr, VideoPacket*(const webrtc::DesktopFrame& frame)); private: DISALLOW_COPY_AND_ASSIGN(MockVideoEncoder); @@ -158,7 +159,6 @@ TEST_F(VideoSchedulerTest, StartAndStop) { frame_.reset(new webrtc::BasicDesktopFrame( webrtc::DesktopSize(kWidth, kHeight))); - webrtc::DesktopFrame* frame_ptr = frame_.get(); // First the capturer is called. Expectation capturer_capture = EXPECT_CALL(*capturer, Capture(_)) @@ -166,7 +166,7 @@ TEST_F(VideoSchedulerTest, StartAndStop) { .WillRepeatedly(Invoke(this, &VideoSchedulerTest::OnCaptureFrame)); // Expect the encoder be called. - EXPECT_CALL(*encoder_, Encode(frame_ptr, _)) + EXPECT_CALL(*encoder_, EncodePtr(_)) .WillRepeatedly(FinishEncode()); // By default delete the arguments when ProcessVideoPacket is received. -- cgit v1.1