OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <time.h> | 5 #include <time.h> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/third_party/nspr/prtime.h" | 8 #include "base/third_party/nspr/prtime.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
| 12 using base::Time; |
| 13 |
12 namespace { | 14 namespace { |
13 | 15 |
14 // time_t representation of 15th Oct 2007 12:45:00 PDT | 16 // time_t representation of 15th Oct 2007 12:45:00 PDT |
15 PRTime comparison_time_pdt = 1192477500 * Time::kMicrosecondsPerSecond; | 17 PRTime comparison_time_pdt = 1192477500 * Time::kMicrosecondsPerSecond; |
16 | 18 |
17 // Specialized test fixture allowing time strings without timezones to be | 19 // Specialized test fixture allowing time strings without timezones to be |
18 // tested by comparing them to a known time in the local zone. | 20 // tested by comparing them to a known time in the local zone. |
19 class PRTimeTest : public testing::Test { | 21 class PRTimeTest : public testing::Test { |
20 protected: | 22 protected: |
21 virtual void SetUp() { | 23 virtual void SetUp() { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 &parsed_time)); | 232 &parsed_time)); |
231 EXPECT_EQ(-300003599, parsed_time.ToTimeT()); | 233 EXPECT_EQ(-300003599, parsed_time.ToTimeT()); |
232 } | 234 } |
233 | 235 |
234 TEST_F(PRTimeTest, ParseTimeTestEmpty) { | 236 TEST_F(PRTimeTest, ParseTimeTestEmpty) { |
235 Time parsed_time; | 237 Time parsed_time; |
236 EXPECT_FALSE(Time::FromString(L"", &parsed_time)); | 238 EXPECT_FALSE(Time::FromString(L"", &parsed_time)); |
237 } | 239 } |
238 | 240 |
239 } // namespace | 241 } // namespace |
OLD | NEW |