OLD | NEW |
| (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 | |
OLD | NEW |