Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Side by Side Diff: net/quic/quic_time_test.cc

Issue 12334063: Land recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more EXPECT_FALSE Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/quic_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/quic/quic_time.h" 5 #include "net/quic/quic_time.h"
6 #include "net/quic/test_tools/mock_clock.h" 6 #include "net/quic/test_tools/mock_clock.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace net { 9 namespace net {
10 namespace test { 10 namespace test {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 TEST_F(QuicTimeTest, SubtractDelta) { 92 TEST_F(QuicTimeTest, SubtractDelta) {
93 QuicTime time = QuicTime::FromMilliseconds(2); 93 QuicTime time = QuicTime::FromMilliseconds(2);
94 EXPECT_EQ(QuicTime::FromMilliseconds(1), 94 EXPECT_EQ(QuicTime::FromMilliseconds(1),
95 time.Subtract(QuicTime::Delta::FromMilliseconds(1))); 95 time.Subtract(QuicTime::Delta::FromMilliseconds(1)));
96 } 96 }
97 97
98 TEST_F(QuicTimeTest, MockClock) { 98 TEST_F(QuicTimeTest, MockClock) {
99 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 99 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
100 100
101 QuicTime now = clock_.Now(); 101 QuicTime now = clock_.ApproximateNow();
102 QuicTime time = QuicTime::FromMicroseconds(1000); 102 QuicTime time = QuicTime::FromMicroseconds(1000);
103 103
104 EXPECT_EQ(now, time); 104 EXPECT_EQ(now, time);
105 105
106 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 106 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
107 now = clock_.Now(); 107 now = clock_.ApproximateNow();
108 108
109 EXPECT_NE(now, time); 109 EXPECT_NE(now, time);
110 110
111 time = time.Add(QuicTime::Delta::FromMilliseconds(1)); 111 time = time.Add(QuicTime::Delta::FromMilliseconds(1));
112 EXPECT_EQ(now, time); 112 EXPECT_EQ(now, time);
113 } 113 }
114 114
115 } // namespace test 115 } // namespace test
116 } // namespace net 116 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_sequencer_test.cc ('k') | net/quic/quic_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698