Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: ui/base/l10n/time_format_unittest.cc

Issue 2747253004: Implement (FORMAT_ELAPSED, LENGTH_LONG) in time_format (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/l10n/time_format.h ('k') | ui/strings/ui_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/l10n/time_format_unittest.cc
diff --git a/ui/base/l10n/time_format_unittest.cc b/ui/base/l10n/time_format_unittest.cc
index 5e2face2485902822732ea4c6a5c915ea9db9d59..61ce7aa806a5112aa815e71583170e3cfab4c2ca 100644
--- a/ui/base/l10n/time_format_unittest.cc
+++ b/ui/base/l10n/time_format_unittest.cc
@@ -115,6 +115,18 @@ class TimeFormatTest : public ::testing::Test {
TimeFormat::FORMAT_ELAPSED, TimeFormat::LENGTH_SHORT, delta_1h_));
EXPECT_EQ(ASCIIToUTF16("1 day ago"), TimeFormat::Simple(
TimeFormat::FORMAT_ELAPSED, TimeFormat::LENGTH_SHORT, delta_1d_));
+ EXPECT_EQ(ASCIIToUTF16("1 second ago"),
+ TimeFormat::Simple(TimeFormat::FORMAT_ELAPSED,
+ TimeFormat::LENGTH_LONG, delta_1s_));
+ EXPECT_EQ(ASCIIToUTF16("1 minute ago"),
+ TimeFormat::Simple(TimeFormat::FORMAT_ELAPSED,
+ TimeFormat::LENGTH_LONG, delta_1m_));
+ EXPECT_EQ(ASCIIToUTF16("1 hour ago"),
+ TimeFormat::Simple(TimeFormat::FORMAT_ELAPSED,
+ TimeFormat::LENGTH_LONG, delta_1h_));
+ EXPECT_EQ(ASCIIToUTF16("1 day ago"),
+ TimeFormat::Simple(TimeFormat::FORMAT_ELAPSED,
+ TimeFormat::LENGTH_LONG, delta_1d_));
// Test English strings (simple, plural).
EXPECT_EQ(ASCIIToUTF16("2 secs"), TimeFormat::Simple(
@@ -157,6 +169,18 @@ class TimeFormatTest : public ::testing::Test {
TimeFormat::FORMAT_ELAPSED, TimeFormat::LENGTH_SHORT, delta_2h_));
EXPECT_EQ(ASCIIToUTF16("2 days ago"), TimeFormat::Simple(
TimeFormat::FORMAT_ELAPSED, TimeFormat::LENGTH_SHORT, delta_2d_));
+ EXPECT_EQ(ASCIIToUTF16("2 seconds ago"),
+ TimeFormat::Simple(TimeFormat::FORMAT_ELAPSED,
+ TimeFormat::LENGTH_LONG, delta_2s_));
+ EXPECT_EQ(ASCIIToUTF16("2 minutes ago"),
+ TimeFormat::Simple(TimeFormat::FORMAT_ELAPSED,
+ TimeFormat::LENGTH_LONG, delta_2m_));
+ EXPECT_EQ(ASCIIToUTF16("2 hours ago"),
+ TimeFormat::Simple(TimeFormat::FORMAT_ELAPSED,
+ TimeFormat::LENGTH_SHORT, delta_2h_));
+ EXPECT_EQ(ASCIIToUTF16("2 days ago"),
+ TimeFormat::Simple(TimeFormat::FORMAT_ELAPSED,
+ TimeFormat::LENGTH_SHORT, delta_2d_));
// Test English strings (detailed, singular and plural).
EXPECT_EQ(ASCIIToUTF16("1 minute and 2 seconds"), TimeFormat::Detailed(
« no previous file with comments | « ui/base/l10n/time_format.h ('k') | ui/strings/ui_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698