OLD | NEW |
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 "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 "base/task.h" | 9 #include "base/task.h" |
10 #include "remoting/base/base_mock_objects.h" | 10 #include "remoting/base/base_mock_objects.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 packet->set_flags(VideoPacket::LAST_PACKET | VideoPacket::LAST_PARTITION); | 45 packet->set_flags(VideoPacket::LAST_PACKET | VideoPacket::LAST_PARTITION); |
46 arg2.Run(packet.release()); | 46 arg2.Run(packet.release()); |
47 } | 47 } |
48 | 48 |
49 ACTION(FinishSend) { | 49 ACTION(FinishSend) { |
50 arg1.Run(); | 50 arg1.Run(); |
51 } | 51 } |
52 | 52 |
53 // Helper method to quit the main message loop. | 53 // Helper method to quit the main message loop. |
54 void QuitMessageLoop(MessageLoop* message_loop) { | 54 void QuitMessageLoop(MessageLoop* message_loop) { |
55 message_loop->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 55 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
56 } | 56 } |
57 | 57 |
58 ACTION_P2(StopScreenRecorder, recorder, task) { | 58 ACTION_P2(StopScreenRecorder, recorder, task) { |
59 recorder->Stop(task); | 59 recorder->Stop(task); |
60 } | 60 } |
61 | 61 |
62 } // namespace | 62 } // namespace |
63 | 63 |
64 static const int kWidth = 640; | 64 static const int kWidth = 640; |
65 static const int kHeight = 480; | 65 static const int kHeight = 480; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 record_->Start(); | 163 record_->Start(); |
164 message_loop_.Run(); | 164 message_loop_.Run(); |
165 } | 165 } |
166 | 166 |
167 TEST_F(ScreenRecorderTest, StopWithoutStart) { | 167 TEST_F(ScreenRecorderTest, StopWithoutStart) { |
168 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_)); | 168 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_)); |
169 message_loop_.Run(); | 169 message_loop_.Run(); |
170 } | 170 } |
171 | 171 |
172 } // namespace remoting | 172 } // namespace remoting |
OLD | NEW |