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

Side by Side Diff: base/profiler/tracked_time_unittest.cc

Issue 18119002: Use a direct include of time headers in base/, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 7 years, 5 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 | « base/profiler/tracked_time.cc ('k') | base/synchronization/cancellation_flag_unittest.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 // Test of classes in tracked_time.cc 5 // Test of classes in tracked_time.cc
6 6
7 #include "base/profiler/tracked_time.h" 7 #include "base/profiler/tracked_time.h"
8 #include "base/time.h" 8 #include "base/time/time.h"
9 #include "base/tracked_objects.h" 9 #include "base/tracked_objects.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 namespace tracked_objects { 12 namespace tracked_objects {
13 13
14 TEST(TrackedTimeTest, TrackedTimerMilliseconds) { 14 TEST(TrackedTimeTest, TrackedTimerMilliseconds) {
15 // First make sure we basicallly transfer simple milliseconds values as 15 // First make sure we basicallly transfer simple milliseconds values as
16 // expected. Most critically, things should not become null. 16 // expected. Most critically, things should not become null.
17 int32 kSomeMilliseconds = 243; // Some example times. 17 int32 kSomeMilliseconds = 243; // Some example times.
18 int64 kReallyBigMilliseconds = (1LL << 35) + kSomeMilliseconds; 18 int64 kReallyBigMilliseconds = (1LL << 35) + kSomeMilliseconds;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 EXPECT_FALSE(ticks_after.is_null()); 101 EXPECT_FALSE(ticks_after.is_null());
102 102
103 // Now make sure that we bracketed our tracked time nicely. 103 // Now make sure that we bracketed our tracked time nicely.
104 Duration before = now - TrackedTime(ticks_before); 104 Duration before = now - TrackedTime(ticks_before);
105 EXPECT_LE(0, before.InMilliseconds()); 105 EXPECT_LE(0, before.InMilliseconds());
106 Duration after = now - TrackedTime(ticks_after); 106 Duration after = now - TrackedTime(ticks_after);
107 EXPECT_GE(0, after.InMilliseconds()); 107 EXPECT_GE(0, after.InMilliseconds());
108 } 108 }
109 109
110 } // namespace tracked_objects 110 } // namespace tracked_objects
OLDNEW
« no previous file with comments | « base/profiler/tracked_time.cc ('k') | base/synchronization/cancellation_flag_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698