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/client/client_status_logger.h" | 5 #include "remoting/client/client_status_logger.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "remoting/protocol/performance_tracker.h" | 8 #include "remoting/protocol/performance_tracker.h" |
9 #include "remoting/signaling/mock_signal_strategy.h" | 9 #include "remoting/signaling/mock_signal_strategy.h" |
10 #include "remoting/signaling/server_log_entry_unittest.h" | 10 #include "remoting/signaling/server_log_entry_unittest.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 EXPECT_CALL(signal_strategy_, RemoveListener(_)); | 69 EXPECT_CALL(signal_strategy_, RemoveListener(_)); |
70 client_status_logger_.reset( | 70 client_status_logger_.reset( |
71 new ClientStatusLogger(ServerLogEntry::ME2ME, | 71 new ClientStatusLogger(ServerLogEntry::ME2ME, |
72 &signal_strategy_, | 72 &signal_strategy_, |
73 kTestBotJid)); | 73 kTestBotJid)); |
74 } | 74 } |
75 | 75 |
76 protected: | 76 protected: |
77 base::MessageLoop message_loop_; | 77 base::MessageLoop message_loop_; |
78 MockSignalStrategy signal_strategy_; | 78 MockSignalStrategy signal_strategy_; |
79 scoped_ptr<ClientStatusLogger> client_status_logger_; | 79 std::unique_ptr<ClientStatusLogger> client_status_logger_; |
80 }; | 80 }; |
81 | 81 |
82 TEST_F(ClientStatusLoggerTest, LogStateChange) { | 82 TEST_F(ClientStatusLoggerTest, LogStateChange) { |
83 { | 83 { |
84 InSequence s; | 84 InSequence s; |
85 EXPECT_CALL(signal_strategy_, GetLocalJid()) | 85 EXPECT_CALL(signal_strategy_, GetLocalJid()) |
86 .WillRepeatedly(Return(kClientJid)); | 86 .WillRepeatedly(Return(kClientJid)); |
87 EXPECT_CALL(signal_strategy_, AddListener(_)); | 87 EXPECT_CALL(signal_strategy_, AddListener(_)); |
88 EXPECT_CALL(signal_strategy_, GetNextId()); | 88 EXPECT_CALL(signal_strategy_, GetNextId()); |
89 EXPECT_CALL(signal_strategy_, SendStanzaPtr( | 89 EXPECT_CALL(signal_strategy_, SendStanzaPtr( |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 protocol::PerformanceTracker perf_tracker; | 144 protocol::PerformanceTracker perf_tracker; |
145 client_status_logger_->LogStatistics(&perf_tracker); | 145 client_status_logger_->LogStatistics(&perf_tracker); |
146 | 146 |
147 client_status_logger_->SetSignalingStateForTest(SignalStrategy::CONNECTED); | 147 client_status_logger_->SetSignalingStateForTest(SignalStrategy::CONNECTED); |
148 client_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED); | 148 client_status_logger_->SetSignalingStateForTest(SignalStrategy::DISCONNECTED); |
149 message_loop_.Run(); | 149 message_loop_.Run(); |
150 } | 150 } |
151 | 151 |
152 } // namespace remoting | 152 } // namespace remoting |
OLD | NEW |