OLD | NEW |
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/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 "base/task.h" | 8 #include "base/task.h" |
9 #include "remoting/host/capturer_fake.h" | 9 #include "remoting/host/capturer_fake.h" |
10 #include "remoting/host/chromoting_host.h" | 10 #include "remoting/host/chromoting_host.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 391 |
392 TEST_F(ChromotingHostTest, CurtainModeFailSecond) { | 392 TEST_F(ChromotingHostTest, CurtainModeFailSecond) { |
393 host_->Start(); | 393 host_->Start(); |
394 | 394 |
395 // When a video packet is received we connect the second mock | 395 // When a video packet is received we connect the second mock |
396 // connection. | 396 // connection. |
397 { | 397 { |
398 InSequence s; | 398 InSequence s; |
399 EXPECT_CALL(*curtain_, EnableCurtainMode(true)) | 399 EXPECT_CALL(*curtain_, EnableCurtainMode(true)) |
400 .WillOnce(QuitMainMessageLoop(&message_loop_)); | 400 .WillOnce(QuitMainMessageLoop(&message_loop_)); |
401 EXPECT_CALL(*disconnect_window_, Show(_, _)) | 401 EXPECT_CALL(*local_input_monitor_, Start(_)) |
402 .Times(0); | 402 .Times(1); |
| 403 EXPECT_CALL(*disconnect_window_, Show(_, "user@domain")) |
| 404 .Times(1); |
403 EXPECT_CALL(video_stub_, ProcessVideoPacket(_, _)) | 405 EXPECT_CALL(video_stub_, ProcessVideoPacket(_, _)) |
404 .WillOnce(DoAll( | 406 .WillOnce(DoAll( |
405 InvokeWithoutArgs( | 407 InvokeWithoutArgs( |
406 CreateFunctor( | 408 CreateFunctor( |
407 this, | 409 this, |
408 &ChromotingHostTest::SimulateClientConnection, 1, false)), | 410 &ChromotingHostTest::SimulateClientConnection, 1, false)), |
409 RunDoneTask())) | 411 RunDoneTask())) |
410 .RetiresOnSaturation(); | 412 .RetiresOnSaturation(); |
411 // Check that the second connection does not affect curtain mode. | 413 // Check that the second connection does not affect curtain mode. |
412 EXPECT_CALL(*curtain_, EnableCurtainMode(_)) | 414 EXPECT_CALL(*curtain_, EnableCurtainMode(_)) |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 .Times(1) | 466 .Times(1) |
465 .InSequence(s2); | 467 .InSequence(s2); |
466 } | 468 } |
467 SimulateClientConnection(0, true); | 469 SimulateClientConnection(0, true); |
468 message_loop_.Run(); | 470 message_loop_.Run(); |
469 host_->set_it2me(false); | 471 host_->set_it2me(false); |
470 EXPECT_THAT(curtain_activated, false); | 472 EXPECT_THAT(curtain_activated, false); |
471 } | 473 } |
472 | 474 |
473 } // namespace remoting | 475 } // namespace remoting |
OLD | NEW |