OLD | NEW |
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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/win/scoped_handle.h" | 9 #include "base/win/scoped_handle.h" |
10 #include "base/win/scoped_process_information.h" | 10 #include "base/win/scoped_process_information.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 void WorkerProcessLauncherTest::SendFakeMessageToLauncher() { | 304 void WorkerProcessLauncherTest::SendFakeMessageToLauncher() { |
305 if (channel_client_) | 305 if (channel_client_) |
306 channel_client_->Send(new ChromotingDesktopNetworkMsg_DisconnectSession()); | 306 channel_client_->Send(new ChromotingDesktopNetworkMsg_DisconnectSession()); |
307 } | 307 } |
308 | 308 |
309 void WorkerProcessLauncherTest::CrashWorker() { | 309 void WorkerProcessLauncherTest::CrashWorker() { |
310 launcher_->Crash(FROM_HERE); | 310 launcher_->Crash(FROM_HERE); |
311 } | 311 } |
312 | 312 |
313 void WorkerProcessLauncherTest::StartWorker() { | 313 void WorkerProcessLauncherTest::StartWorker() { |
314 launcher_.reset(new WorkerProcessLauncher(launcher_delegate_.Pass(), | 314 launcher_.reset(new WorkerProcessLauncher( |
315 &server_listener_)); | 315 launcher_delegate_.PassAs<WorkerProcessLauncher::Delegate>(), |
| 316 &server_listener_)); |
316 | 317 |
317 launcher_->SetKillProcessTimeoutForTest(base::TimeDelta::FromMilliseconds(0)); | 318 launcher_->SetKillProcessTimeoutForTest(base::TimeDelta::FromMilliseconds(0)); |
318 } | 319 } |
319 | 320 |
320 void WorkerProcessLauncherTest::StopWorker() { | 321 void WorkerProcessLauncherTest::StopWorker() { |
321 launcher_.reset(); | 322 launcher_.reset(); |
322 DisconnectClient(); | 323 DisconnectClient(); |
323 channel_name_.clear(); | 324 channel_name_.clear(); |
324 channel_server_.reset(); | 325 channel_server_.reset(); |
325 task_runner_ = NULL; | 326 task_runner_ = NULL; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 EXPECT_CALL(client_listener_, OnCrash(_, _, _)) | 522 EXPECT_CALL(client_listener_, OnCrash(_, _, _)) |
522 .Times(1) | 523 .Times(1) |
523 .WillOnce(InvokeWithoutArgs( | 524 .WillOnce(InvokeWithoutArgs( |
524 this, &WorkerProcessLauncherTest::SendFakeMessageToLauncher)); | 525 this, &WorkerProcessLauncherTest::SendFakeMessageToLauncher)); |
525 | 526 |
526 StartWorker(); | 527 StartWorker(); |
527 message_loop_.Run(); | 528 message_loop_.Run(); |
528 } | 529 } |
529 | 530 |
530 } // namespace remoting | 531 } // namespace remoting |
OLD | NEW |