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

Side by Side Diff: third_party/WebKit/Source/wtf/TimeTest.cpp

Issue 2543663002: Provide simple wrappers for base/time types in WTF (Closed)
Patch Set: Consistent mocking Created 4 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
« no previous file with comments | « third_party/WebKit/Source/wtf/Time.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "wtf/Time.h"
2
3 #include "testing/gtest/include/gtest/gtest.h"
4
5 namespace WTF {
6 namespace {
7
8 TEST(TimeTicks, NumericOperations) {
9 TimeTicks zero;
10 ASSERT_EQ(0, zero.ToInternalValueForTesting());
11
12 TimeTicks t1 = zero + TimeDelta::FromMilliseconds(1001);
13 ASSERT_EQ(1001000, t1.ToInternalValueForTesting());
14
15 TimeTicks t2 = zero + TimeDelta::FromSeconds(1);
16 ASSERT_EQ(TimeDelta::FromMilliseconds(1), t1 - t2);
17 }
18
19 TEST(Time, NumericOperations) {
20 Time zero;
21 ASSERT_EQ(0, zero.ToInternalValueForTesting());
22
23 Time t1 = zero + TimeDelta::FromMilliseconds(1001);
24 ASSERT_EQ(1001000, t1.ToInternalValueForTesting());
25
26 Time t2 = zero + TimeDelta::FromSeconds(1);
27 ASSERT_EQ(TimeDelta::FromMilliseconds(1), t1 - t2);
28 }
29
30 } // namespace
31 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/Time.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698