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 "components/network_time/network_time_tracker.h" | 5 #include "components/network_time/network_time_tracker.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/prefs/testing_pref_service.h" | |
12 #include "base/time/tick_clock.h" | 11 #include "base/time/tick_clock.h" |
| 12 #include "components/prefs/testing_pref_service.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 | 14 |
15 namespace network_time { | 15 namespace network_time { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // These are all in milliseconds. | 19 // These are all in milliseconds. |
20 const int64_t kLatency1 = 50; | 20 const int64_t kLatency1 = 50; |
21 const int64_t kLatency2 = 500; | 21 const int64_t kLatency2 = 500; |
22 | 22 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 AddToTicksNow(kPseudoSleepTime2); | 153 AddToTicksNow(kPseudoSleepTime2); |
154 UpdateNetworkTime( | 154 UpdateNetworkTime( |
155 old_now, | 155 old_now, |
156 base::TimeDelta::FromMilliseconds(kResolution2), | 156 base::TimeDelta::FromMilliseconds(kResolution2), |
157 base::TimeDelta::FromMilliseconds(kLatency2), | 157 base::TimeDelta::FromMilliseconds(kLatency2), |
158 old_ticks); | 158 old_ticks); |
159 EXPECT_TRUE(ValidateExpectedTime()); | 159 EXPECT_TRUE(ValidateExpectedTime()); |
160 } | 160 } |
161 | 161 |
162 } // namespace network_time | 162 } // namespace network_time |
OLD | NEW |