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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 void DaemonProcessTest::LaunchNetworkProcess() { | 198 void DaemonProcessTest::LaunchNetworkProcess() { |
199 terminal_id_ = 0; | 199 terminal_id_ = 0; |
200 daemon_process_->OnChannelConnected(0); | 200 daemon_process_->OnChannelConnected(0); |
201 } | 201 } |
202 | 202 |
203 void DaemonProcessTest::DeleteDaemonProcess() { | 203 void DaemonProcessTest::DeleteDaemonProcess() { |
204 daemon_process_.reset(); | 204 daemon_process_.reset(); |
205 } | 205 } |
206 | 206 |
207 void DaemonProcessTest::QuitMessageLoop() { | 207 void DaemonProcessTest::QuitMessageLoop() { |
208 message_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); | 208 message_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
209 } | 209 } |
210 | 210 |
211 void DaemonProcessTest::StartDaemonProcess() { | 211 void DaemonProcessTest::StartDaemonProcess() { |
212 // DaemonProcess::Initialize() sets up the config watcher that this test does | 212 // DaemonProcess::Initialize() sets up the config watcher that this test does |
213 // not support. Launch the process directly. | 213 // not support. Launch the process directly. |
214 daemon_process_->LaunchNetworkProcess(); | 214 daemon_process_->LaunchNetworkProcess(); |
215 } | 215 } |
216 | 216 |
217 MATCHER_P(Message, type, "") { | 217 MATCHER_P(Message, type, "") { |
218 return arg.type() == static_cast<uint32>(type); | 218 return arg.type() == static_cast<uint32>(type); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 EXPECT_EQ(1u, desktop_sessions().size()); | 332 EXPECT_EQ(1u, desktop_sessions().size()); |
333 EXPECT_EQ(id, desktop_sessions().front()->id()); | 333 EXPECT_EQ(id, desktop_sessions().front()->id()); |
334 | 334 |
335 EXPECT_TRUE(daemon_process_->OnMessageReceived( | 335 EXPECT_TRUE(daemon_process_->OnMessageReceived( |
336 ChromotingNetworkHostMsg_ConnectTerminal(id, resolution, false))); | 336 ChromotingNetworkHostMsg_ConnectTerminal(id, resolution, false))); |
337 EXPECT_TRUE(desktop_sessions().empty()); | 337 EXPECT_TRUE(desktop_sessions().empty()); |
338 EXPECT_EQ(0, terminal_id_); | 338 EXPECT_EQ(0, terminal_id_); |
339 } | 339 } |
340 | 340 |
341 } // namespace remoting | 341 } // namespace remoting |
OLD | NEW |