OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/google_apis/time_util.h" | 5 #include "chrome/browser/google_apis/time_util.h" |
6 | 6 |
7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
| 8 #include "base/strings/utf_string_conversions.h" |
8 #include "base/time.h" | 9 #include "base/time.h" |
9 #include "base/utf_string_conversions.h" | |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
12 #if defined(OS_CHROMEOS) | 12 #if defined(OS_CHROMEOS) |
13 #include "chrome/browser/chromeos/system/timezone_settings.h" | 13 #include "chrome/browser/chromeos/system/timezone_settings.h" |
14 #endif // OS_CHROMEOS | 14 #endif // OS_CHROMEOS |
15 | 15 |
16 namespace google_apis { | 16 namespace google_apis { |
17 namespace util { | 17 namespace util { |
18 namespace { | 18 namespace { |
19 | 19 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 TEST(TimeUtilTest, FormatTimeAsStringLocalTime) { | 108 TEST(TimeUtilTest, FormatTimeAsStringLocalTime) { |
109 base::Time::Exploded exploded_time = {2012, 7, 0, 19, 15, 59, 13, 123}; | 109 base::Time::Exploded exploded_time = {2012, 7, 0, 19, 15, 59, 13, 123}; |
110 base::Time time = base::Time::FromLocalExploded(exploded_time); | 110 base::Time time = base::Time::FromLocalExploded(exploded_time); |
111 EXPECT_EQ("2012-07-19T15:59:13.123", FormatTimeAsStringLocaltime(time)); | 111 EXPECT_EQ("2012-07-19T15:59:13.123", FormatTimeAsStringLocaltime(time)); |
112 | 112 |
113 EXPECT_EQ("null", FormatTimeAsStringLocaltime(base::Time())); | 113 EXPECT_EQ("null", FormatTimeAsStringLocaltime(base::Time())); |
114 } | 114 } |
115 | 115 |
116 } // namespace util | 116 } // namespace util |
117 } // namespace google_apis | 117 } // namespace google_apis |
OLD | NEW |