Title: [128257] trunk/Source
Revision
128257
Author
kei...@webkit.org
Date
2012-09-11 19:24:57 -0700 (Tue, 11 Sep 2012)

Log Message

Create Localizer factory method for LocaleICU
https://bugs.webkit.org/show_bug.cgi?id=96363

Reviewed by Kent Tamura.

Source/WebCore:

Preparing to use Localizer instead of LocaleMac/Win/ICU

No new tests. Covered in unit test tests/LocalizedNumberICUTest.cpp

* platform/text/LocaleICU.cpp:
(WebCore::Localizer::create):
(WebCore):

Source/WebKit/chromium:

* tests/LocalizedNumberICUTest.cpp:
(testNumberIsReversible):
(testDecimalSeparator):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (128256 => 128257)


--- trunk/Source/WebCore/ChangeLog	2012-09-12 01:57:23 UTC (rev 128256)
+++ trunk/Source/WebCore/ChangeLog	2012-09-12 02:24:57 UTC (rev 128257)
@@ -1,3 +1,18 @@
+2012-09-11  Keishi Hattori  <kei...@webkit.org>
+
+        Create Localizer factory method for LocaleICU
+        https://bugs.webkit.org/show_bug.cgi?id=96363
+
+        Reviewed by Kent Tamura.
+
+        Preparing to use Localizer instead of LocaleMac/Win/ICU
+
+        No new tests. Covered in unit test tests/LocalizedNumberICUTest.cpp
+
+        * platform/text/LocaleICU.cpp:
+        (WebCore::Localizer::create):
+        (WebCore):
+
 2012-09-11  Michael Saboff  <msab...@apple.com>
 
         Build fixed for http://trac.webkit.org/changeset/128243

Modified: trunk/Source/WebCore/platform/text/LocaleICU.cpp (128256 => 128257)


--- trunk/Source/WebCore/platform/text/LocaleICU.cpp	2012-09-12 01:57:23 UTC (rev 128256)
+++ trunk/Source/WebCore/platform/text/LocaleICU.cpp	2012-09-12 02:24:57 UTC (rev 128257)
@@ -42,6 +42,11 @@
 
 namespace WebCore {
 
+PassOwnPtr<Localizer> Localizer::create(const AtomicString& locale)
+{
+    return LocaleICU::create(locale.string().utf8().data());
+}
+
 LocaleICU::LocaleICU(const char* locale)
     : m_locale(locale)
     , m_numberFormat(0)

Modified: trunk/Source/WebKit/chromium/ChangeLog (128256 => 128257)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-09-12 01:57:23 UTC (rev 128256)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-09-12 02:24:57 UTC (rev 128257)
@@ -1,3 +1,14 @@
+2012-09-11  Keishi Hattori  <kei...@webkit.org>
+
+        Create Localizer factory method for LocaleICU
+        https://bugs.webkit.org/show_bug.cgi?id=96363
+
+        Reviewed by Kent Tamura.
+
+        * tests/LocalizedNumberICUTest.cpp:
+        (testNumberIsReversible):
+        (testDecimalSeparator):
+
 2012-09-11  Christopher Cameron  <ccame...@chromium.org>
 
         [chromium] Make prioritized texture manager not touch backings array on the main thread

Modified: trunk/Source/WebKit/chromium/tests/LocalizedNumberICUTest.cpp (128256 => 128257)


--- trunk/Source/WebKit/chromium/tests/LocalizedNumberICUTest.cpp	2012-09-12 01:57:23 UTC (rev 128256)
+++ trunk/Source/WebKit/chromium/tests/LocalizedNumberICUTest.cpp	2012-09-12 02:24:57 UTC (rev 128257)
@@ -36,13 +36,13 @@
 
 using namespace WebCore;
 
-void testNumberIsReversible(const char* localeString, const char* original, const char* shouldHave = 0)
+void testNumberIsReversible(const AtomicString& locale, const char* original, const char* shouldHave = 0)
 {
-    OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
-    String localized = locale->convertToLocalizedNumber(original);
+    OwnPtr<Localizer> localizer = Localizer::create(locale);
+    String localized = localizer->convertToLocalizedNumber(original);
     if (shouldHave)
         EXPECT_TRUE(localized.contains(shouldHave));
-    String converted = locale->convertFromLocalizedNumber(localized);
+    String converted = localizer->convertFromLocalizedNumber(localized);
     EXPECT_EQ(original, converted);
 }
 
@@ -82,10 +82,10 @@
 
 #if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
 
-static String testDecimalSeparator(const char* localeString)
+static String testDecimalSeparator(const AtomicString& locale)
 {
-    OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
-    return locale->localizedDecimalSeparator();
+    OwnPtr<Localizer> localizer = Localizer::create(locale);
+    return localizer->localizedDecimalSeparator();
 }
 
 TEST(LocalizedNumberICUTest, localizedDecimalSeparator)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to