| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/test/connection_time_observer.h" | 5 #include "remoting/test/connection_time_observer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 ~ConnectionTimeObserverTest() override; | 22 ~ConnectionTimeObserverTest() override; |
| 23 | 23 |
| 24 protected: | 24 protected: |
| 25 // Test interface. | 25 // Test interface. |
| 26 void SetUp() override; | 26 void SetUp() override; |
| 27 | 27 |
| 28 // A map of fake times to calculate TimeDelta between two states. | 28 // A map of fake times to calculate TimeDelta between two states. |
| 29 std::map<protocol::ConnectionToHost::State, base::TimeTicks> test_map_; | 29 std::map<protocol::ConnectionToHost::State, base::TimeTicks> test_map_; |
| 30 | 30 |
| 31 // Observes and saves the times when the chromoting connection state changes. | 31 // Observes and saves the times when the chromoting connection state changes. |
| 32 scoped_ptr<ConnectionTimeObserver> connection_time_observer_; | 32 std::unique_ptr<ConnectionTimeObserver> connection_time_observer_; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(ConnectionTimeObserverTest); | 35 DISALLOW_COPY_AND_ASSIGN(ConnectionTimeObserverTest); |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 ConnectionTimeObserverTest::ConnectionTimeObserverTest() { | 38 ConnectionTimeObserverTest::ConnectionTimeObserverTest() { |
| 39 } | 39 } |
| 40 | 40 |
| 41 ConnectionTimeObserverTest::~ConnectionTimeObserverTest() { | 41 ConnectionTimeObserverTest::~ConnectionTimeObserverTest() { |
| 42 } | 42 } |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 connection_time_observer_->ConnectionStateChanged( | 168 connection_time_observer_->ConnectionStateChanged( |
| 169 protocol::ConnectionToHost::State::CONNECTED, protocol::ErrorCode::OK); | 169 protocol::ConnectionToHost::State::CONNECTED, protocol::ErrorCode::OK); |
| 170 | 170 |
| 171 EXPECT_EQ(connection_time_observer_->GetStateTransitionTime( | 171 EXPECT_EQ(connection_time_observer_->GetStateTransitionTime( |
| 172 protocol::ConnectionToHost::State::INITIALIZING, | 172 protocol::ConnectionToHost::State::INITIALIZING, |
| 173 protocol::ConnectionToHost::State::CONNECTED), first_time_delta); | 173 protocol::ConnectionToHost::State::CONNECTED), first_time_delta); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace test | 176 } // namespace test |
| 177 } // namespace remoting | 177 } // namespace remoting |
| OLD | NEW |