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

Side by Side Diff: remoting/client/software_video_renderer_unittest.cc

Issue 1559043004: Add GetFrameConsumer() in VideoRenderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_video_renderer
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « remoting/client/software_video_renderer.cc ('k') | remoting/protocol/frame_consumer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/client/software_video_renderer.h" 5 #include "remoting/client/software_video_renderer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/memory/scoped_vector.h" 13 #include "base/memory/scoped_vector.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "base/run_loop.h" 15 #include "base/run_loop.h"
16 #include "base/threading/thread.h" 16 #include "base/threading/thread.h"
17 #include "remoting/client/frame_consumer.h"
18 #include "remoting/codec/video_encoder_verbatim.h" 17 #include "remoting/codec/video_encoder_verbatim.h"
19 #include "remoting/proto/video.pb.h" 18 #include "remoting/proto/video.pb.h"
19 #include "remoting/protocol/frame_consumer.h"
20 #include "remoting/protocol/session_config.h" 20 #include "remoting/protocol/session_config.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" 22 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
23 23
24 using webrtc::DesktopFrame; 24 using webrtc::DesktopFrame;
25 25
26 namespace remoting { 26 namespace remoting {
27 27
28 namespace { 28 namespace {
29 29
30 const int kFrameWidth = 200; 30 const int kFrameWidth = 200;
31 const int kFrameHeight = 200; 31 const int kFrameHeight = 200;
32 32
33 class TestFrameConsumer : public FrameConsumer { 33 class TestFrameConsumer : public protocol::FrameConsumer {
34 public: 34 public:
35 TestFrameConsumer() {} 35 TestFrameConsumer() {}
36 ~TestFrameConsumer() override {} 36 ~TestFrameConsumer() override {}
37 37
38 scoped_ptr<DesktopFrame> WaitForNextFrame(base::Closure* out_done_callback) { 38 scoped_ptr<DesktopFrame> WaitForNextFrame(base::Closure* out_done_callback) {
39 EXPECT_TRUE(thread_checker_.CalledOnValidThread()); 39 EXPECT_TRUE(thread_checker_.CalledOnValidThread());
40 frame_run_loop_.reset(new base::RunLoop()); 40 frame_run_loop_.reset(new base::RunLoop());
41 frame_run_loop_->Run(); 41 frame_run_loop_->Run();
42 frame_run_loop_.reset(); 42 frame_run_loop_.reset();
43 *out_done_callback = last_frame_done_callback_; 43 *out_done_callback = last_frame_done_callback_;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 EXPECT_FALSE(callback_called[frame_index]); 176 EXPECT_FALSE(callback_called[frame_index]);
177 done_callback.Run(); 177 done_callback.Run();
178 EXPECT_TRUE(callback_called[frame_index]); 178 EXPECT_TRUE(callback_called[frame_index]);
179 179
180 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame)); 180 EXPECT_TRUE(CompareFrames(*test_frames[frame_index], *decoded_frame));
181 } 181 }
182 } 182 }
183 183
184 } // namespace remoting 184 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/software_video_renderer.cc ('k') | remoting/protocol/frame_consumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698