| 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 "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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 ACTION_P2(RunCallback, region, data) { | 36 ACTION_P2(RunCallback, region, data) { |
| 37 SkRegion& dirty_region = data->mutable_dirty_region(); | 37 SkRegion& dirty_region = data->mutable_dirty_region(); |
| 38 dirty_region.op(region, SkRegion::kUnion_Op); | 38 dirty_region.op(region, SkRegion::kUnion_Op); |
| 39 arg0.Run(data); | 39 arg0.Run(data); |
| 40 } | 40 } |
| 41 | 41 |
| 42 ACTION(FinishEncode) { | 42 ACTION(FinishEncode) { |
| 43 scoped_ptr<VideoPacket> packet(new VideoPacket()); | 43 scoped_ptr<VideoPacket> packet(new VideoPacket()); |
| 44 packet->set_flags(VideoPacket::LAST_PACKET | VideoPacket::LAST_PARTITION); | 44 packet->set_flags(VideoPacket::LAST_PACKET | VideoPacket::LAST_PARTITION); |
| 45 arg2.Run(packet.release()); | 45 arg2.Run(packet.Pass()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 ACTION(FinishSend) { | 48 ACTION(FinishSend) { |
| 49 arg1.Run(); | 49 arg1.Run(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Helper method to quit the main message loop. | 52 // Helper method to quit the main message loop. |
| 53 void QuitMessageLoop(MessageLoop* message_loop) { | 53 void QuitMessageLoop(MessageLoop* message_loop) { |
| 54 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 54 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 55 } | 55 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 record_->Start(); | 162 record_->Start(); |
| 163 message_loop_.Run(); | 163 message_loop_.Run(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 TEST_F(ScreenRecorderTest, StopWithoutStart) { | 166 TEST_F(ScreenRecorderTest, StopWithoutStart) { |
| 167 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_)); | 167 record_->Stop(base::Bind(&QuitMessageLoop, &message_loop_)); |
| 168 message_loop_.Run(); | 168 message_loop_.Run(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace remoting | 171 } // namespace remoting |
| OLD | NEW |