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

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

Issue 10823244: Remove the HostEventStub aggregate interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/chromoting_host.cc ('k') | remoting/host/client_session.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "remoting/jingle_glue/mock_objects.h" 8 #include "remoting/jingle_glue/mock_objects.h"
9 #include "remoting/host/audio_capturer.h" 9 #include "remoting/host/audio_capturer.h"
10 #include "remoting/host/chromoting_host_context.h" 10 #include "remoting/host/chromoting_host_context.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 187 }
188 188
189 // Helper method to pretend a client is connected to ChromotingHost. 189 // Helper method to pretend a client is connected to ChromotingHost.
190 void SimulateClientConnection(int connection_index, bool authenticate, 190 void SimulateClientConnection(int connection_index, bool authenticate,
191 bool reject) { 191 bool reject) {
192 scoped_ptr<protocol::ConnectionToClient> connection = 192 scoped_ptr<protocol::ConnectionToClient> connection =
193 ((connection_index == 0) ? owned_connection1_ : owned_connection2_). 193 ((connection_index == 0) ? owned_connection1_ : owned_connection2_).
194 PassAs<protocol::ConnectionToClient>(); 194 PassAs<protocol::ConnectionToClient>();
195 protocol::ConnectionToClient* connection_ptr = connection.get(); 195 protocol::ConnectionToClient* connection_ptr = connection.get();
196 ClientSession* client = new ClientSession( 196 ClientSession* client = new ClientSession(
197 host_.get(), connection.Pass(), desktop_environment_->event_executor(), 197 host_.get(),
198 desktop_environment_->capturer(), base::TimeDelta()); 198 connection.Pass(),
199 desktop_environment_->event_executor(),
200 desktop_environment_->event_executor(),
201 desktop_environment_->capturer(),
202 base::TimeDelta());
199 connection_ptr->set_host_stub(client); 203 connection_ptr->set_host_stub(client);
200 204
201 context_.network_task_runner()->PostTask( 205 context_.network_task_runner()->PostTask(
202 FROM_HERE, base::Bind(&ChromotingHostTest::AddClientToHost, 206 FROM_HERE, base::Bind(&ChromotingHostTest::AddClientToHost,
203 host_, client)); 207 host_, client));
204 208
205 if (authenticate) { 209 if (authenticate) {
206 context_.network_task_runner()->PostTask( 210 context_.network_task_runner()->PostTask(
207 FROM_HERE, base::Bind(&ClientSession::OnConnectionAuthenticated, 211 FROM_HERE, base::Bind(&ClientSession::OnConnectionAuthenticated,
208 base::Unretained(client), connection_ptr)); 212 base::Unretained(client), connection_ptr));
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 ExpectClientDisconnected(0, true, video_packet_sent, 629 ExpectClientDisconnected(0, true, video_packet_sent,
626 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); 630 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost));
627 EXPECT_CALL(host_status_observer_, OnShutdown()); 631 EXPECT_CALL(host_status_observer_, OnShutdown());
628 632
629 host_->Start(); 633 host_->Start();
630 SimulateClientConnection(0, true, false); 634 SimulateClientConnection(0, true, false);
631 message_loop_.Run(); 635 message_loop_.Run();
632 } 636 }
633 637
634 } // namespace remoting 638 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/host/client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698