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 "net/tools/quic/quic_epoll_connection_helper.h" | 5 #include "net/tools/quic/quic_epoll_connection_helper.h" |
6 | 6 |
7 #include "net/quic/crypto/quic_random.h" | 7 #include "net/quic/crypto/quic_random.h" |
8 #include "net/tools/quic/test_tools/mock_epoll_server.h" | 8 #include "net/tools/quic/test_tools/mock_epoll_server.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 QuicEpollConnectionHelper helper_; | 23 QuicEpollConnectionHelper helper_; |
24 }; | 24 }; |
25 | 25 |
26 TEST_F(QuicEpollConnectionHelperTest, GetClock) { | 26 TEST_F(QuicEpollConnectionHelperTest, GetClock) { |
27 const QuicClock* clock = helper_.GetClock(); | 27 const QuicClock* clock = helper_.GetClock(); |
28 QuicTime start = clock->Now(); | 28 QuicTime start = clock->Now(); |
29 | 29 |
30 QuicTime::Delta delta = QuicTime::Delta::FromMilliseconds(5); | 30 QuicTime::Delta delta = QuicTime::Delta::FromMilliseconds(5); |
31 epoll_server_.AdvanceBy(delta.ToMicroseconds()); | 31 epoll_server_.AdvanceBy(delta.ToMicroseconds()); |
32 | 32 |
33 EXPECT_EQ(start.Add(delta), clock->Now()); | 33 EXPECT_EQ(start + delta, clock->Now()); |
34 } | 34 } |
35 | 35 |
36 TEST_F(QuicEpollConnectionHelperTest, GetRandomGenerator) { | 36 TEST_F(QuicEpollConnectionHelperTest, GetRandomGenerator) { |
37 QuicRandom* random = helper_.GetRandomGenerator(); | 37 QuicRandom* random = helper_.GetRandomGenerator(); |
38 EXPECT_EQ(QuicRandom::GetInstance(), random); | 38 EXPECT_EQ(QuicRandom::GetInstance(), random); |
39 } | 39 } |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 } // namespace test | 42 } // namespace test |
43 } // namespace net | 43 } // namespace net |
OLD | NEW |