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

Unified Diff: base/time/time_unittest.cc

Issue 1122153002: Fixit: Fork base::TimeTicks --> TimeTicks + ThreadTicks + TraceTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FIXIT_timeclasses_1of2
Patch Set: REBASE after it passed CQ but did not commit to tree Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/time/time_posix.cc ('k') | base/time/time_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time_unittest.cc
diff --git a/base/time/time_unittest.cc b/base/time/time_unittest.cc
index 1ee3269ef6c3fc90ff8caa7fb8a0220bb4e98a2d..b7e05b786b490bbb0ede2aabc3f09cffc990eb6a 100644
--- a/base/time/time_unittest.cc
+++ b/base/time/time_unittest.cc
@@ -690,15 +690,15 @@ TEST(TimeTicks, HighRes) {
#else
#define MAYBE_ThreadNow ThreadNow
#endif
-TEST(TimeTicks, MAYBE_ThreadNow) {
- if (TimeTicks::IsThreadNowSupported()) {
+TEST(ThreadTicks, MAYBE_ThreadNow) {
+ if (ThreadTicks::IsSupported()) {
TimeTicks begin = TimeTicks::Now();
- TimeTicks begin_thread = TimeTicks::ThreadNow();
+ ThreadTicks begin_thread = ThreadTicks::Now();
// Make sure that ThreadNow value is non-zero.
- EXPECT_GT(begin_thread, TimeTicks());
+ EXPECT_GT(begin_thread, ThreadTicks());
// Sleep for 10 milliseconds to get the thread de-scheduled.
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10));
- TimeTicks end_thread = TimeTicks::ThreadNow();
+ ThreadTicks end_thread = ThreadTicks::Now();
TimeTicks end = TimeTicks::Now();
TimeDelta delta = end - begin;
TimeDelta delta_thread = end_thread - begin_thread;
@@ -710,9 +710,10 @@ TEST(TimeTicks, MAYBE_ThreadNow) {
}
}
-TEST(TimeTicks, NowFromSystemTraceTime) {
+TEST(TraceTicks, NowFromSystemTraceTime) {
// Re-use HighRes test for now since clock properties are identical.
- HighResClockTest(&TimeTicks::NowFromSystemTraceTime);
+ using NowFunction = TimeTicks (*)(void);
+ HighResClockTest(reinterpret_cast<NowFunction>(&TraceTicks::Now));
}
TEST(TimeTicks, SnappedToNextTickBasic) {
« no previous file with comments | « base/time/time_posix.cc ('k') | base/time/time_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698