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

Unified Diff: base/time/time_unittest.cc

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 6 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 456782c64525c45c4921e3a6c9ecafb457378566..b7e05b786b490bbb0ede2aabc3f09cffc990eb6a 100644
--- a/base/time/time_unittest.cc
+++ b/base/time/time_unittest.cc
@@ -4,8 +4,8 @@
#include "base/time/time.h"
+#include <stdint.h>
#include <time.h>
-
#include <limits>
#include <string>
@@ -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) {
@@ -832,7 +833,7 @@ TEST(TimeDelta, WindowsEpoch) {
exploded.millisecond = 0;
Time t = Time::FromUTCExploded(exploded);
// Unix 1970 epoch.
- EXPECT_EQ(GG_INT64_C(11644473600000000), t.ToInternalValue());
+ EXPECT_EQ(INT64_C(11644473600000000), t.ToInternalValue());
// We can't test 1601 epoch, since the system time functions on Linux
// only compute years starting from 1900.
« 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