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

Side by Side Diff: remoting/host/screen_recorder_unittest.cc

Issue 10790075: Rename Capturer to VideoFrameCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased. Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/screen_recorder.cc ('k') | remoting/host/simple_host_process.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/host/screen_recorder.h" 5 #include "remoting/host/screen_recorder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "remoting/base/base_mock_objects.h" 9 #include "remoting/base/base_mock_objects.h"
10 #include "remoting/host/host_mock_objects.h" 10 #include "remoting/host/host_mock_objects.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 static const media::VideoFrame::Format kFormat = media::VideoFrame::RGB32; 66 static const media::VideoFrame::Format kFormat = media::VideoFrame::RGB32;
67 static const VideoPacketFormat::Encoding kEncoding = 67 static const VideoPacketFormat::Encoding kEncoding =
68 VideoPacketFormat::ENCODING_VERBATIM; 68 VideoPacketFormat::ENCODING_VERBATIM;
69 69
70 class ScreenRecorderTest : public testing::Test { 70 class ScreenRecorderTest : public testing::Test {
71 public: 71 public:
72 ScreenRecorderTest() { 72 ScreenRecorderTest() {
73 } 73 }
74 74
75 virtual void SetUp() OVERRIDE { 75 virtual void SetUp() OVERRIDE {
76 // Capturer and Encoder are owned by ScreenRecorder. 76 // VideoFrameCapturer and Encoder are owned by ScreenRecorder.
77 encoder_ = new MockEncoder(); 77 encoder_ = new MockEncoder();
78 78
79 session_ = new MockSession(); 79 session_ = new MockSession();
80 EXPECT_CALL(*session_, SetEventHandler(_)); 80 EXPECT_CALL(*session_, SetEventHandler(_));
81 EXPECT_CALL(*session_, Close()) 81 EXPECT_CALL(*session_, Close())
82 .Times(AnyNumber()); 82 .Times(AnyNumber());
83 connection_.reset(new MockConnectionToClient( 83 connection_.reset(new MockConnectionToClient(
84 session_, &host_stub_, &event_executor_)); 84 session_, &host_stub_, &event_executor_));
85 connection_->SetEventHandler(&handler_); 85 connection_->SetEventHandler(&handler_);
86 86
(...skipping 13 matching lines...) Expand all
100 MessageLoop message_loop_; 100 MessageLoop message_loop_;
101 scoped_refptr<ScreenRecorder> record_; 101 scoped_refptr<ScreenRecorder> record_;
102 102
103 MockConnectionToClientEventHandler handler_; 103 MockConnectionToClientEventHandler handler_;
104 MockHostStub host_stub_; 104 MockHostStub host_stub_;
105 MockEventExecutor event_executor_; 105 MockEventExecutor event_executor_;
106 MockSession* session_; // Owned by |connection_|. 106 MockSession* session_; // Owned by |connection_|.
107 scoped_ptr<MockConnectionToClient> connection_; 107 scoped_ptr<MockConnectionToClient> connection_;
108 108
109 // The following mock objects are owned by ScreenRecorder. 109 // The following mock objects are owned by ScreenRecorder.
110 MockCapturer capturer_; 110 MockVideoFrameCapturer capturer_;
111 MockEncoder* encoder_; 111 MockEncoder* encoder_;
112 112
113 private: 113 private:
114 DISALLOW_COPY_AND_ASSIGN(ScreenRecorderTest); 114 DISALLOW_COPY_AND_ASSIGN(ScreenRecorderTest);
115 }; 115 };
116 116
117 // This test mocks capturer, encoder and network layer to simulate one recording 117 // This test mocks capturer, encoder and network layer to simulate one recording
118 // cycle. When the first encoded packet is submitted to the network 118 // cycle. When the first encoded packet is submitted to the network
119 // ScreenRecorder is instructed to come to a complete stop. We expect the stop 119 // ScreenRecorder is instructed to come to a complete stop. We expect the stop
120 // sequence to be executed successfully. 120 // sequence to be executed successfully.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 message_loop_.Run(); 169 message_loop_.Run();
170 } 170 }
171 171
172 TEST_F(ScreenRecorderTest, StopWithoutStart) { 172 TEST_F(ScreenRecorderTest, StopWithoutStart) {
173 EXPECT_CALL(capturer_, Stop()); 173 EXPECT_CALL(capturer_, Stop());
174 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_)); 174 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_));
175 message_loop_.Run(); 175 message_loop_.Run();
176 } 176 }
177 177
178 } // namespace remoting 178 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/screen_recorder.cc ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698