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

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

Issue 7633009: Use MessageLoopProxy for network message loop. (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
« no previous file with comments | « remoting/host/screen_recorder.cc ('k') | remoting/jingle_glue/jingle_thread.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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 #include "base/task.h" 6 #include "base/task.h"
7 #include "remoting/base/base_mock_objects.h" 7 #include "remoting/base/base_mock_objects.h"
8 #include "remoting/host/host_mock_objects.h" 8 #include "remoting/host/host_mock_objects.h"
9 #include "remoting/host/screen_recorder.h" 9 #include "remoting/host/screen_recorder.h"
10 #include "remoting/proto/video.pb.h" 10 #include "remoting/proto/video.pb.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 class ScreenRecorderTest : public testing::Test { 74 class ScreenRecorderTest : public testing::Test {
75 public: 75 public:
76 ScreenRecorderTest() { 76 ScreenRecorderTest() {
77 } 77 }
78 78
79 virtual void SetUp() { 79 virtual void SetUp() {
80 // Capturer and Encoder are owned by ScreenRecorder. 80 // Capturer and Encoder are owned by ScreenRecorder.
81 encoder_ = new MockEncoder(); 81 encoder_ = new MockEncoder();
82 82
83 connection_ = new MockConnectionToClient(&message_loop_, &handler_, 83 connection_ = new MockConnectionToClient(
84 &host_stub_, &event_executor_); 84 &handler_, &host_stub_, &event_executor_);
85 85
86 record_ = new ScreenRecorder( 86 record_ = new ScreenRecorder(
87 &message_loop_, &message_loop_, &message_loop_, 87 &message_loop_, &message_loop_,
88 base::MessageLoopProxy::CreateForCurrentThread(),
88 &capturer_, encoder_); 89 &capturer_, encoder_);
89 } 90 }
90 91
91 protected: 92 protected:
92 scoped_refptr<ScreenRecorder> record_; 93 scoped_refptr<ScreenRecorder> record_;
93 94
94 MockConnectionToClientEventHandler handler_; 95 MockConnectionToClientEventHandler handler_;
95 MockHostStub host_stub_; 96 MockHostStub host_stub_;
96 MockEventExecutor event_executor_; 97 MockEventExecutor event_executor_;
97 scoped_refptr<MockConnectionToClient> connection_; 98 scoped_refptr<MockConnectionToClient> connection_;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 record_->Start(); 202 record_->Start();
202 message_loop_.Run(); 203 message_loop_.Run();
203 } 204 }
204 205
205 TEST_F(ScreenRecorderTest, StopWithoutStart) { 206 TEST_F(ScreenRecorderTest, StopWithoutStart) {
206 record_->Stop(NewRunnableFunction(&QuitMessageLoop, &message_loop_)); 207 record_->Stop(NewRunnableFunction(&QuitMessageLoop, &message_loop_));
207 message_loop_.Run(); 208 message_loop_.Run();
208 } 209 }
209 210
210 } // namespace remoting 211 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/screen_recorder.cc ('k') | remoting/jingle_glue/jingle_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698