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

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

Issue 9720019: Use scoped_ptr<> to pass ownership in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/server_log_entry.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 (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
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
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
OLDNEW
« no previous file with comments | « remoting/host/screen_recorder.cc ('k') | remoting/host/server_log_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698