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

Side by Side Diff: remoting/protocol/video_frame_pump_unittest.cc

Issue 2483483004: [Chromoting] Implement new APIs in DesktopCapturer (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/video_frame_pump.h" 5 #include "remoting/protocol/video_frame_pump.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 EXPECT_TRUE(task_runner_->BelongsToCurrentThread()); 114 EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
115 115
116 std::unique_ptr<webrtc::DesktopFrame> frame( 116 std::unique_ptr<webrtc::DesktopFrame> frame(
117 new webrtc::BasicDesktopFrame(webrtc::DesktopSize(kWidth, kHeight))); 117 new webrtc::BasicDesktopFrame(webrtc::DesktopSize(kWidth, kHeight)));
118 frame->mutable_updated_region()->SetRect( 118 frame->mutable_updated_region()->SetRect(
119 webrtc::DesktopRect::MakeXYWH(0, 0, 10, 10)); 119 webrtc::DesktopRect::MakeXYWH(0, 0, 10, 10));
120 callback_->OnCaptureResult(webrtc::DesktopCapturer::Result::SUCCESS, 120 callback_->OnCaptureResult(webrtc::DesktopCapturer::Result::SUCCESS,
121 std::move(frame)); 121 std::move(frame));
122 } 122 }
123 123
124 bool GetSourceList(SourceList* sources) override {
125 EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
126 return true;
Sergey Ulanov 2016/11/05 00:16:26 return false;
Hzj_jie 2016/11/06 04:27:24 Done.
127 }
128
129 bool SelectSource(SourceId id) override {
130 EXPECT_TRUE(task_runner_->BelongsToCurrentThread());
131 return true;
132 }
133
124 private: 134 private:
125 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 135 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
126 webrtc::DesktopCapturer::Callback* callback_; 136 webrtc::DesktopCapturer::Callback* callback_;
127 137
128 DISALLOW_COPY_AND_ASSIGN(ThreadCheckDesktopCapturer); 138 DISALLOW_COPY_AND_ASSIGN(ThreadCheckDesktopCapturer);
129 }; 139 };
130 140
131 class VideoFramePumpTest : public testing::Test { 141 class VideoFramePumpTest : public testing::Test {
132 public: 142 public:
133 void SetUp() override; 143 void SetUp() override;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Start video frame capture. 247 // Start video frame capture.
238 pump_.reset(new VideoFramePump(encode_task_runner_, std::move(capturer), 248 pump_.reset(new VideoFramePump(encode_task_runner_, std::move(capturer),
239 std::move(encoder), &video_stub_)); 249 std::move(encoder), &video_stub_));
240 250
241 // Run MessageLoop until the first frame is received. 251 // Run MessageLoop until the first frame is received.
242 run_loop.Run(); 252 run_loop.Run();
243 } 253 }
244 254
245 } // namespace protocol 255 } // namespace protocol
246 } // namespace remoting 256 } // namespace remoting
OLDNEW
« remoting/protocol/fake_desktop_capturer.h ('K') | « remoting/protocol/fake_desktop_capturer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698