OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/host_status_logger.h" | 5 #include "remoting/host/host_status_logger.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "remoting/host/fake_host_status_monitor.h" | 8 #include "remoting/host/fake_host_status_monitor.h" |
9 #include "remoting/signaling/mock_signal_strategy.h" | 9 #include "remoting/signaling/mock_signal_strategy.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 new HostStatusLogger(host_status_monitor_.AsWeakPtr(), | 130 new HostStatusLogger(host_status_monitor_.AsWeakPtr(), |
131 ServerLogEntry::ME2ME, | 131 ServerLogEntry::ME2ME, |
132 &signal_strategy_, | 132 &signal_strategy_, |
133 kTestBotJid)); | 133 kTestBotJid)); |
134 EXPECT_CALL(signal_strategy_, RemoveListener(_)); | 134 EXPECT_CALL(signal_strategy_, RemoveListener(_)); |
135 } | 135 } |
136 | 136 |
137 protected: | 137 protected: |
138 base::MessageLoop message_loop_; | 138 base::MessageLoop message_loop_; |
139 MockSignalStrategy signal_strategy_; | 139 MockSignalStrategy signal_strategy_; |
140 scoped_ptr<HostStatusLogger> host_status_logger_; | 140 std::unique_ptr<HostStatusLogger> host_status_logger_; |
141 FakeHostStatusMonitor host_status_monitor_; | 141 FakeHostStatusMonitor host_status_monitor_; |
142 }; | 142 }; |
143 | 143 |
144 TEST_F(HostStatusLoggerTest, SendNow) { | 144 TEST_F(HostStatusLoggerTest, SendNow) { |
145 { | 145 { |
146 InSequence s; | 146 InSequence s; |
147 EXPECT_CALL(signal_strategy_, GetLocalJid()) | 147 EXPECT_CALL(signal_strategy_, GetLocalJid()) |
148 .WillRepeatedly(Return(kHostJid)); | 148 .WillRepeatedly(Return(kHostJid)); |
149 EXPECT_CALL(signal_strategy_, AddListener(_)); | 149 EXPECT_CALL(signal_strategy_, AddListener(_)); |
150 EXPECT_CALL(signal_strategy_, GetNextId()); | 150 EXPECT_CALL(signal_strategy_, GetNextId()); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 route2.type = protocol::TransportRoute::STUN; | 246 route2.type = protocol::TransportRoute::STUN; |
247 host_status_logger_->OnClientRouteChange(kClientJid2, "video", route2); | 247 host_status_logger_->OnClientRouteChange(kClientJid2, "video", route2); |
248 host_status_logger_->OnClientDisconnected(kClientJid1); | 248 host_status_logger_->OnClientDisconnected(kClientJid1); |
249 host_status_logger_->OnClientAuthenticated(kClientJid2); | 249 host_status_logger_->OnClientAuthenticated(kClientJid2); |
250 host_status_logger_->OnClientConnected(kClientJid2); | 250 host_status_logger_->OnClientConnected(kClientJid2); |
251 host_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED); | 251 host_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED); |
252 message_loop_.Run(); | 252 message_loop_.Run(); |
253 } | 253 } |
254 | 254 |
255 } // namespace remoting | 255 } // namespace remoting |
OLD | NEW |