OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "crypto/nss_util.h" | 5 #include "crypto/nss_util.h" |
6 | 6 |
7 #include <prtime.h> | 7 #include <prtime.h> |
8 | 8 |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // warnings about type downcasting. | 27 // warnings about type downcasting. |
28 exploded.day_of_week = prxtime.tm_wday = 0; // Should be unused. | 28 exploded.day_of_week = prxtime.tm_wday = 0; // Should be unused. |
29 exploded.day_of_month = prxtime.tm_mday = 10; | 29 exploded.day_of_month = prxtime.tm_mday = 10; |
30 exploded.hour = prxtime.tm_hour = 2; | 30 exploded.hour = prxtime.tm_hour = 2; |
31 exploded.minute = prxtime.tm_min = 52; | 31 exploded.minute = prxtime.tm_min = 52; |
32 exploded.second = prxtime.tm_sec = 19; | 32 exploded.second = prxtime.tm_sec = 19; |
33 exploded.millisecond = 342; | 33 exploded.millisecond = 342; |
34 prxtime.tm_usec = 342000; | 34 prxtime.tm_usec = 342000; |
35 | 35 |
36 PRTime pr_time = PR_ImplodeTime(&prxtime); | 36 PRTime pr_time = PR_ImplodeTime(&prxtime); |
37 base::Time base_time = base::Time::FromUTCExploded(exploded); | 37 base::Time base_time; |
| 38 EXPECT_TRUE(base::Time::FromUTCExploded(exploded, &base_time)); |
38 | 39 |
39 EXPECT_EQ(base_time, PRTimeToBaseTime(pr_time)); | 40 EXPECT_EQ(base_time, PRTimeToBaseTime(pr_time)); |
40 EXPECT_EQ(pr_time, BaseTimeToPRTime(base_time)); | 41 EXPECT_EQ(pr_time, BaseTimeToPRTime(base_time)); |
41 } | 42 } |
42 | 43 |
43 } // namespace crypto | 44 } // namespace crypto |
OLD | NEW |