Changeset 128257 in webkit


Ignore:
Timestamp:
Sep 11, 2012 7:24:57 PM (12 years ago)
Author:
keishi@webkit.org
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):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128256 r128257  
     12012-09-11  Keishi Hattori  <keishi@webkit.org>
     2
     3        Create Localizer factory method for LocaleICU
     4        https://bugs.webkit.org/show_bug.cgi?id=96363
     5
     6        Reviewed by Kent Tamura.
     7
     8        Preparing to use Localizer instead of LocaleMac/Win/ICU
     9
     10        No new tests. Covered in unit test tests/LocalizedNumberICUTest.cpp
     11
     12        * platform/text/LocaleICU.cpp:
     13        (WebCore::Localizer::create):
     14        (WebCore):
     15
    1162012-09-11  Michael Saboff  <msaboff@apple.com>
    217
  • trunk/Source/WebCore/platform/text/LocaleICU.cpp

    r128147 r128257  
    4242
    4343namespace WebCore {
     44
     45PassOwnPtr<Localizer> Localizer::create(const AtomicString& locale)
     46{
     47    return LocaleICU::create(locale.string().utf8().data());
     48}
    4449
    4550LocaleICU::LocaleICU(const char* locale)
  • trunk/Source/WebKit/chromium/ChangeLog

    r128253 r128257  
     12012-09-11  Keishi Hattori  <keishi@webkit.org>
     2
     3        Create Localizer factory method for LocaleICU
     4        https://bugs.webkit.org/show_bug.cgi?id=96363
     5
     6        Reviewed by Kent Tamura.
     7
     8        * tests/LocalizedNumberICUTest.cpp:
     9        (testNumberIsReversible):
     10        (testDecimalSeparator):
     11
    1122012-09-11  Christopher Cameron  <ccameron@chromium.org>
    213
  • trunk/Source/WebKit/chromium/tests/LocalizedNumberICUTest.cpp

    r121404 r128257  
    3737using namespace WebCore;
    3838
    39 void testNumberIsReversible(const char* localeString, const char* original, const char* shouldHave = 0)
     39void testNumberIsReversible(const AtomicString& locale, const char* original, const char* shouldHave = 0)
    4040{
    41     OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
    42     String localized = locale->convertToLocalizedNumber(original);
     41    OwnPtr<Localizer> localizer = Localizer::create(locale);
     42    String localized = localizer->convertToLocalizedNumber(original);
    4343    if (shouldHave)
    4444        EXPECT_TRUE(localized.contains(shouldHave));
    45     String converted = locale->convertFromLocalizedNumber(localized);
     45    String converted = localizer->convertFromLocalizedNumber(localized);
    4646    EXPECT_EQ(original, converted);
    4747}
     
    8383#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
    8484
    85 static String testDecimalSeparator(const char* localeString)
     85static String testDecimalSeparator(const AtomicString& locale)
    8686{
    87     OwnPtr<LocaleICU> locale = LocaleICU::create(localeString);
    88     return locale->localizedDecimalSeparator();
     87    OwnPtr<Localizer> localizer = Localizer::create(locale);
     88    return localizer->localizedDecimalSeparator();
    8989}
    9090
Note: See TracChangeset for help on using the changeset viewer.