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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "base/message_loop_proxy.h" | 6 #include "base/message_loop_proxy.h" |
7 #include "remoting/jingle_glue/mock_objects.h" | 7 #include "remoting/jingle_glue/mock_objects.h" |
8 #include "remoting/host/log_to_server.h" | 8 #include "remoting/host/log_to_server.h" |
9 #include "testing/gmock_mutant.h" | 9 #include "testing/gmock_mutant.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 12 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
13 | 13 |
14 using testing::_; | 14 using testing::_; |
15 using testing::DeleteArg; | 15 using testing::DeleteArg; |
16 using testing::InSequence; | 16 using testing::InSequence; |
17 using testing::Return; | 17 using testing::Return; |
18 | 18 |
19 namespace remoting { | 19 namespace remoting { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 ACTION_P(QuitMainMessageLoop, message_loop) { | 23 ACTION_P(QuitMainMessageLoop, message_loop) { |
24 message_loop->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 24 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
25 } | 25 } |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 class LogToServerTest : public testing::Test { | 29 class LogToServerTest : public testing::Test { |
30 public: | 30 public: |
31 LogToServerTest() {} | 31 LogToServerTest() {} |
32 virtual void SetUp() OVERRIDE { | 32 virtual void SetUp() OVERRIDE { |
33 message_loop_proxy_ = base::MessageLoopProxy::current(); | 33 message_loop_proxy_ = base::MessageLoopProxy::current(); |
34 log_to_server_.reset(new LogToServer(message_loop_proxy_)); | 34 log_to_server_.reset(new LogToServer(message_loop_proxy_)); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 log_to_server_->OnClientAuthenticated("client@domain.com/5678"); | 91 log_to_server_->OnClientAuthenticated("client@domain.com/5678"); |
92 log_to_server_->OnClientAuthenticated("client2@domain.com/6789"); | 92 log_to_server_->OnClientAuthenticated("client2@domain.com/6789"); |
93 log_to_server_->OnSignallingConnected(&signal_strategy_, | 93 log_to_server_->OnSignallingConnected(&signal_strategy_, |
94 "host@domain.com/1234"); | 94 "host@domain.com/1234"); |
95 log_to_server_->OnSignallingDisconnected(); | 95 log_to_server_->OnSignallingDisconnected(); |
96 message_loop_.Run(); | 96 message_loop_.Run(); |
97 } | 97 } |
98 | 98 |
99 } // namespace remoting | 99 } // namespace remoting |
OLD | NEW |