Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3538)

Unified Diff: remoting/host/video_scheduler_unittest.cc

Issue 23477059: Simplify VideoEncoder interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/video_scheduler.cc ('k') | remoting/proto/video.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/video_scheduler_unittest.cc
diff --git a/remoting/host/video_scheduler_unittest.cc b/remoting/host/video_scheduler_unittest.cc
index 2dd7afbf195f2561d50a32c88c0230e7b7527954..25567d27baa35a34df4a6c2ddc99a2ea0766def8 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.
« no previous file with comments | « remoting/host/video_scheduler.cc ('k') | remoting/proto/video.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698