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 <windows.h> | 5 #include <windows.h> |
6 #include <mmsystem.h> | 6 #include <mmsystem.h> |
7 #include <process.h> | 7 #include <process.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <limits> | 10 #include <limits> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/win/registry.h" | 15 #include "base/win/registry.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/googletest/include/gtest/gtest.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 namespace { | 19 namespace { |
20 | 20 |
21 class MockTimeTicks : public TimeTicks { | 21 class MockTimeTicks : public TimeTicks { |
22 public: | 22 public: |
23 static DWORD Ticker() { | 23 static DWORD Ticker() { |
24 return static_cast<int>(InterlockedIncrement(&ticker_)); | 24 return static_cast<int>(InterlockedIncrement(&ticker_)); |
25 } | 25 } |
26 | 26 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 static_cast<double>((converted_value - TimeTicks()).InMicroseconds()); | 287 static_cast<double>((converted_value - TimeTicks()).InMicroseconds()); |
288 EXPECT_NEAR(expected_microseconds_since_origin, | 288 EXPECT_NEAR(expected_microseconds_since_origin, |
289 converted_microseconds_since_origin, | 289 converted_microseconds_since_origin, |
290 1.0) | 290 1.0) |
291 << "ticks=" << ticks << ", to be converted via logic path: " | 291 << "ticks=" << ticks << ", to be converted via logic path: " |
292 << (ticks < Time::kQPCOverflowThreshold ? "FAST" : "SAFE"); | 292 << (ticks < Time::kQPCOverflowThreshold ? "FAST" : "SAFE"); |
293 } | 293 } |
294 } | 294 } |
295 | 295 |
296 } // namespace base | 296 } // namespace base |
OLD | NEW |