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

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

Issue 1466413002: Update gtest to 786564fa4a3c, switch to googlemock in gtest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
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/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/googletest/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;
19 19
20 TrackedTime some = TrackedTime() + 20 TrackedTime some = TrackedTime() +
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 EXPECT_FALSE(ticks_after.is_null()); 94 EXPECT_FALSE(ticks_after.is_null());
95 95
96 // Now make sure that we bracketed our tracked time nicely. 96 // Now make sure that we bracketed our tracked time nicely.
97 Duration before = now - TrackedTime(ticks_before); 97 Duration before = now - TrackedTime(ticks_before);
98 EXPECT_LE(0, before.InMilliseconds()); 98 EXPECT_LE(0, before.InMilliseconds());
99 Duration after = now - TrackedTime(ticks_after); 99 Duration after = now - TrackedTime(ticks_after);
100 EXPECT_GE(0, after.InMilliseconds()); 100 EXPECT_GE(0, after.InMilliseconds());
101 } 101 }
102 102
103 } // namespace tracked_objects 103 } // namespace tracked_objects
OLDNEW
« no previous file with comments | « base/profiler/stack_sampling_profiler_unittest.cc ('k') | base/profiler/win32_stack_frame_unwinder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698