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

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

Issue 7635005: Properly handle screen recorder shutdown in ChromotingHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/bind.h"
5 #include "base/message_loop.h" 6 #include "base/message_loop.h"
6 #include "base/task.h" 7 #include "base/task.h"
7 #include "remoting/base/base_mock_objects.h" 8 #include "remoting/base/base_mock_objects.h"
8 #include "remoting/host/host_mock_objects.h" 9 #include "remoting/host/host_mock_objects.h"
9 #include "remoting/host/screen_recorder.h" 10 #include "remoting/host/screen_recorder.h"
dmac 2011/08/11 23:56:34 NIT: this include should be on top...
Sergey Ulanov 2011/08/12 00:29:48 Done.
10 #include "remoting/proto/video.pb.h" 11 #include "remoting/proto/video.pb.h"
11 #include "remoting/protocol/protocol_mock_objects.h" 12 #include "remoting/protocol/protocol_mock_objects.h"
12 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 using ::remoting::protocol::MockConnectionToClient; 16 using ::remoting::protocol::MockConnectionToClient;
16 using ::remoting::protocol::MockConnectionToClientEventHandler; 17 using ::remoting::protocol::MockConnectionToClientEventHandler;
17 using ::remoting::protocol::MockHostStub; 18 using ::remoting::protocol::MockHostStub;
18 using ::remoting::protocol::MockVideoStub; 19 using ::remoting::protocol::MockVideoStub;
19 20
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 // By default delete the arguments when ProcessVideoPacket is received. 184 // By default delete the arguments when ProcessVideoPacket is received.
184 EXPECT_CALL(video_stub, ProcessVideoPacket(_, _)) 185 EXPECT_CALL(video_stub, ProcessVideoPacket(_, _))
185 .WillRepeatedly(FinishSend()); 186 .WillRepeatedly(FinishSend());
186 187
187 // For the first time when ProcessVideoPacket is received we stop the 188 // For the first time when ProcessVideoPacket is received we stop the
188 // ScreenRecorder. 189 // ScreenRecorder.
189 EXPECT_CALL(video_stub, ProcessVideoPacket(_, _)) 190 EXPECT_CALL(video_stub, ProcessVideoPacket(_, _))
190 .WillOnce(DoAll( 191 .WillOnce(DoAll(
191 FinishSend(), 192 FinishSend(),
192 StopScreenRecorder(record_, 193 StopScreenRecorder(record_,
193 NewRunnableFunction(&QuitMessageLoop, 194 base::Bind(&QuitMessageLoop, &message_loop_))))
194 &message_loop_))))
195 .RetiresOnSaturation(); 195 .RetiresOnSaturation();
196 196
197 // Add the mock client connection to the session. 197 // Add the mock client connection to the session.
198 record_->AddConnection(connection_); 198 record_->AddConnection(connection_);
199 199
200 // Start the recording. 200 // Start the recording.
201 record_->Start(); 201 record_->Start();
202 message_loop_.Run(); 202 message_loop_.Run();
203 } 203 }
204 204
205 TEST_F(ScreenRecorderTest, StopWithoutStart) { 205 TEST_F(ScreenRecorderTest, StopWithoutStart) {
206 record_->Stop(NewRunnableFunction(&QuitMessageLoop, &message_loop_)); 206 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_));
207 message_loop_.Run(); 207 message_loop_.Run();
208 } 208 }
209 209
210 } // namespace remoting 210 } // namespace remoting
OLDNEW
« remoting/host/chromoting_host.cc ('K') | « remoting/host/screen_recorder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698