OLD | NEW |
| (Empty) |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "cc/proto/base_conversions.h" | |
6 | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 namespace cc { | |
10 namespace { | |
11 | |
12 TEST(BaseProtoConversionsTest, SerializeTimeTicks) { | |
13 base::TimeTicks ticks; | |
14 base::TimeTicks new_ticks; | |
15 | |
16 ticks = base::TimeTicks::FromInternalValue(2); | |
17 new_ticks = ProtoToTimeTicks(TimeTicksToProto(ticks)); | |
18 EXPECT_EQ(ticks, new_ticks); | |
19 | |
20 ticks = base::TimeTicks::Now(); | |
21 new_ticks = ProtoToTimeTicks(TimeTicksToProto(ticks)); | |
22 EXPECT_EQ(ticks, new_ticks); | |
23 | |
24 ticks = base::TimeTicks::FromInternalValue(0); | |
25 new_ticks = ProtoToTimeTicks(TimeTicksToProto(ticks)); | |
26 EXPECT_EQ(ticks, new_ticks); | |
27 } | |
28 | |
29 } // namespace | |
30 } // namespace cc | |
OLD | NEW |