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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "media/video/capture/screen/screen_capturer_fake.h" | 9 #include "media/video/capture/screen/screen_capturer_fake.h" |
10 #include "remoting/base/auto_thread_task_runner.h" | 10 #include "remoting/base/auto_thread_task_runner.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 using testing::InvokeArgument; | 43 using testing::InvokeArgument; |
44 using testing::InvokeWithoutArgs; | 44 using testing::InvokeWithoutArgs; |
45 using testing::Return; | 45 using testing::Return; |
46 using testing::ReturnRef; | 46 using testing::ReturnRef; |
47 using testing::Sequence; | 47 using testing::Sequence; |
48 | 48 |
49 namespace remoting { | 49 namespace remoting { |
50 | 50 |
51 namespace { | 51 namespace { |
52 | 52 |
53 void PostQuitTask(MessageLoop* message_loop) { | 53 void PostQuitTask(base::MessageLoop* message_loop) { |
54 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 54 message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); |
55 } | 55 } |
56 | 56 |
57 // Run the task and delete it afterwards. This action is used to deal with | 57 // Run the task and delete it afterwards. This action is used to deal with |
58 // done callbacks. | 58 // done callbacks. |
59 ACTION(RunDoneTask) { | 59 ACTION(RunDoneTask) { |
60 arg1.Run(); | 60 arg1.Run(); |
61 } | 61 } |
62 | 62 |
63 } // namespace | 63 } // namespace |
64 | 64 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 391 |
392 if (expect_host_status_change) { | 392 if (expect_host_status_change) { |
393 EXPECT_CALL(host_status_observer_, OnClientDisconnected(session_jid)) | 393 EXPECT_CALL(host_status_observer_, OnClientDisconnected(session_jid)) |
394 .After(after) | 394 .After(after) |
395 .WillOnce(action) | 395 .WillOnce(action) |
396 .RetiresOnSaturation(); | 396 .RetiresOnSaturation(); |
397 } | 397 } |
398 } | 398 } |
399 | 399 |
400 protected: | 400 protected: |
401 MessageLoop message_loop_; | 401 base::MessageLoop message_loop_; |
402 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; | 402 scoped_refptr<AutoThreadTaskRunner> ui_task_runner_; |
403 MockConnectionToClientEventHandler handler_; | 403 MockConnectionToClientEventHandler handler_; |
404 MockSignalStrategy signal_strategy_; | 404 MockSignalStrategy signal_strategy_; |
405 scoped_ptr<MockDesktopEnvironmentFactory> desktop_environment_factory_; | 405 scoped_ptr<MockDesktopEnvironmentFactory> desktop_environment_factory_; |
406 scoped_refptr<ChromotingHost> host_; | 406 scoped_refptr<ChromotingHost> host_; |
407 MockHostStatusObserver host_status_observer_; | 407 MockHostStatusObserver host_status_observer_; |
408 protocol::MockSessionManager* session_manager_; | 408 protocol::MockSessionManager* session_manager_; |
409 std::string xmpp_login_; | 409 std::string xmpp_login_; |
410 MockConnectionToClient* connection1_; | 410 MockConnectionToClient* connection1_; |
411 scoped_ptr<MockConnectionToClient> owned_connection1_; | 411 scoped_ptr<MockConnectionToClient> owned_connection1_; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 ExpectClientDisconnected(0, true, video_packet_sent, | 653 ExpectClientDisconnected(0, true, video_packet_sent, |
654 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); | 654 InvokeWithoutArgs(this, &ChromotingHostTest::ShutdownHost)); |
655 EXPECT_CALL(host_status_observer_, OnShutdown()); | 655 EXPECT_CALL(host_status_observer_, OnShutdown()); |
656 | 656 |
657 host_->Start(xmpp_login_); | 657 host_->Start(xmpp_login_); |
658 SimulateClientConnection(0, true, false); | 658 SimulateClientConnection(0, true, false); |
659 message_loop_.Run(); | 659 message_loop_.Run(); |
660 } | 660 } |
661 | 661 |
662 } // namespace remoting | 662 } // namespace remoting |
OLD | NEW |