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 "remoting/host/desktop_process.h" | 5 #include "remoting/host/desktop_process.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 RunDesktopProcess(); | 280 RunDesktopProcess(); |
281 } | 281 } |
282 | 282 |
283 void DesktopProcessTest::SendCrashRequest() { | 283 void DesktopProcessTest::SendCrashRequest() { |
284 tracked_objects::Location location = FROM_HERE; | 284 tracked_objects::Location location = FROM_HERE; |
285 daemon_channel_->Send(new ChromotingDaemonMsg_Crash( | 285 daemon_channel_->Send(new ChromotingDaemonMsg_Crash( |
286 location.function_name(), location.file_name(), location.line_number())); | 286 location.function_name(), location.file_name(), location.line_number())); |
287 } | 287 } |
288 | 288 |
289 void DesktopProcessTest::SendStartSessionAgent() { | 289 void DesktopProcessTest::SendStartSessionAgent() { |
290 // TODO(alexeypa): Fix DesktopProcess to use the desktop environment | |
291 // to create the disconnect window instead of directly calling | |
292 // DisconnectWindow::Create(). This will take care of "Uninteresting mock | |
293 // function call" warnings printed when DisconnectWindow::Show() and | |
294 // DisconnectWindow::Hide() are called. | |
295 network_channel_->Send(new ChromotingNetworkDesktopMsg_StartSessionAgent( | 290 network_channel_->Send(new ChromotingNetworkDesktopMsg_StartSessionAgent( |
296 "user@domain/rest-of-jid", ScreenResolution())); | 291 "user@domain/rest-of-jid", ScreenResolution())); |
297 } | 292 } |
298 | 293 |
299 // Launches the desktop process and waits when it connects back. | 294 // Launches the desktop process and waits when it connects back. |
300 TEST_F(DesktopProcessTest, Basic) { | 295 TEST_F(DesktopProcessTest, Basic) { |
301 InSequence s; | 296 InSequence s; |
302 EXPECT_CALL(daemon_listener_, OnChannelConnected(_)); | 297 EXPECT_CALL(daemon_listener_, OnChannelConnected(_)); |
303 EXPECT_CALL(daemon_listener_, OnDesktopAttached(_)) | 298 EXPECT_CALL(daemon_listener_, OnDesktopAttached(_)) |
304 .WillOnce(DoAll( | 299 .WillOnce(DoAll( |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 } | 337 } |
343 | 338 |
344 // Run the desktop process and ask it to crash. | 339 // Run the desktop process and ask it to crash. |
345 TEST_F(DesktopProcessTest, DeathTest) { | 340 TEST_F(DesktopProcessTest, DeathTest) { |
346 testing::GTEST_FLAG(death_test_style) = "threadsafe"; | 341 testing::GTEST_FLAG(death_test_style) = "threadsafe"; |
347 | 342 |
348 EXPECT_DEATH(RunDeathTest(), ""); | 343 EXPECT_DEATH(RunDeathTest(), ""); |
349 } | 344 } |
350 | 345 |
351 } // namespace remoting | 346 } // namespace remoting |
OLD | NEW |