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 "app/l10n_util.h" |
7 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
8 #include "base/time.h" | 9 #include "base/time.h" |
9 #include "chrome/common/l10n_util.h" | |
10 #include "chrome/common/time_format.h" | 10 #include "chrome/common/time_format.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 using base::Time; | 13 using base::Time; |
14 using base::TimeDelta; | 14 using base::TimeDelta; |
15 | 15 |
16 TEST(TimeFormat, RelativeDate) { | 16 TEST(TimeFormat, RelativeDate) { |
17 Time now = Time::Now(); | 17 Time now = Time::Now(); |
18 std::wstring today_str = TimeFormat::RelativeDate(now, NULL); | 18 std::wstring today_str = TimeFormat::RelativeDate(now, NULL); |
19 EXPECT_EQ(L"Today", today_str); | 19 EXPECT_EQ(L"Today", today_str); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 TestTimeFormats(one_sec + twohundred_millisecs, L"1 sec"); | 60 TestTimeFormats(one_sec + twohundred_millisecs, L"1 sec"); |
61 TestTimeFormats(five_secs + twohundred_millisecs, L"5 secs"); | 61 TestTimeFormats(five_secs + twohundred_millisecs, L"5 secs"); |
62 TestTimeFormats(one_min + five_secs, L"1 min"); | 62 TestTimeFormats(one_min + five_secs, L"1 min"); |
63 TestTimeFormats(three_mins + twohundred_millisecs, L"3 mins"); | 63 TestTimeFormats(three_mins + twohundred_millisecs, L"3 mins"); |
64 TestTimeFormats(one_hour + five_secs, L"1 hour"); | 64 TestTimeFormats(one_hour + five_secs, L"1 hour"); |
65 TestTimeFormats(four_hours + five_secs, L"4 hours"); | 65 TestTimeFormats(four_hours + five_secs, L"4 hours"); |
66 TestTimeFormats(one_day + five_secs, L"1 day"); | 66 TestTimeFormats(one_day + five_secs, L"1 day"); |
67 TestTimeFormats(three_days, L"3 days"); | 67 TestTimeFormats(three_days, L"3 days"); |
68 TestTimeFormats(three_days + four_hours, L"3 days"); | 68 TestTimeFormats(three_days + four_hours, L"3 days"); |
69 } | 69 } |
OLD | NEW |