diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-13 22:43:41 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-13 22:43:41 +0000 |
commit | 8b6d3d07dc51f52f3079f300262c4e3c58645ee5 (patch) | |
tree | 3e1bcc9f51197d784222cbc35874882559a990b9 /remoting/host/video_scheduler_unittest.cc | |
parent | f6fad5a315506ff9d8fc49743917df8b201591c8 (diff) | |
download | chromium_src-8b6d3d07dc51f52f3079f300262c4e3c58645ee5.zip chromium_src-8b6d3d07dc51f52f3079f300262c4e3c58645ee5.tar.gz chromium_src-8b6d3d07dc51f52f3079f300262c4e3c58645ee5.tar.bz2 |
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
Diffstat (limited to 'remoting/host/video_scheduler_unittest.cc')
-rw-r--r-- | remoting/host/video_scheduler_unittest.cc | 14 |
1 files changed, 7 insertions, 7 deletions
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<VideoPacket> 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<VideoPacket> Encode( + const webrtc::DesktopFrame& frame) { + return scoped_ptr<VideoPacket>(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. |