diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
commit | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch) | |
tree | 24d68c6f61c464ecba1e05670b80390ea3b0e50c /Source/WebKit/chromium/tests/LocaleMacTest.cpp | |
parent | 69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff) | |
download | qtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz |
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Source/WebKit/chromium/tests/LocaleMacTest.cpp')
-rw-r--r-- | Source/WebKit/chromium/tests/LocaleMacTest.cpp | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/Source/WebKit/chromium/tests/LocaleMacTest.cpp b/Source/WebKit/chromium/tests/LocaleMacTest.cpp index e9e55d81c..0d2fed154 100644 --- a/Source/WebKit/chromium/tests/LocaleMacTest.cpp +++ b/Source/WebKit/chromium/tests/LocaleMacTest.cpp @@ -78,22 +78,10 @@ protected: String formatTime(const String& localeString, int hour, int minute, int second, int millisecond, bool useShortFormat) { OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); - return locale->formatDateTime(timeComponents(hour, minute, second, millisecond), (useShortFormat ? Localizer::FormatTypeShort : Localizer::FormatTypeMedium)); - } - - double parseDate(const String& localeString, const String& dateString) - { - OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); - return locale->parseDateTime(dateString, DateComponents::Date); + return locale->formatDateTime(timeComponents(hour, minute, second, millisecond), (useShortFormat ? Locale::FormatTypeShort : Locale::FormatTypeMedium)); } #if ENABLE(CALENDAR_PICKER) - String dateFormatText(const String& localeString) - { - OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); - return locale->dateFormatText(); - } - unsigned firstDayOfWeek(const String& localeString) { OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); @@ -198,21 +186,7 @@ TEST_F(LocaleMacTest, formatTime) EXPECT_STREQ("\xDB\xB7:\xDB\xB0\xDB\xB7:\xDB\xB0\xDB\xB7\xD9\xAB\xDB\xB0\xDB\xB0\xDB\xB7", formatTime("fa", 07, 07, 07, 007, false).utf8().data()); } -TEST_F(LocaleMacTest, parseDate) -{ - EXPECT_EQ(msForDate(2005, April, 27), parseDate("en_US", "April 27, 2005")); - EXPECT_EQ(msForDate(2005, April, 27), parseDate("fr_FR", "27 avril 2005")); - EXPECT_EQ(msForDate(2005, April, 27), parseDate("ja_JP", "2005/04/27")); -} - #if ENABLE(CALENDAR_PICKER) -TEST_F(LocaleMacTest, dateFormatText) -{ - EXPECT_STREQ("Month/Day/Year", dateFormatText("en_US").utf8().data()); - EXPECT_STREQ("Day/Month/Year", dateFormatText("fr_FR").utf8().data()); - EXPECT_STREQ("Year/Month/Day", dateFormatText("ja_JP").utf8().data()); -} - TEST_F(LocaleMacTest, firstDayOfWeek) { EXPECT_EQ(Sunday, firstDayOfWeek("en_US")); @@ -350,7 +324,7 @@ TEST_F(LocaleMacTest, invalidLocale) static void testNumberIsReversible(const AtomicString& localeString, const char* original, const char* shouldHave = 0) { - OwnPtr<Localizer> locale = Localizer::create(localeString); + OwnPtr<Locale> locale = Locale::create(localeString); String localized = locale->convertToLocalizedNumber(original); if (shouldHave) EXPECT_TRUE(localized.contains(shouldHave)); |