Changeset 243740 in webkit


Ignore:
Timestamp:
Apr 2, 2019 7:31:27 AM (5 years ago)
Author:
Diego Pino Garcia
Message:

REGRESSION(r243512): Change locale of test in intl-datetimeformat.js
https://bugs.webkit.org/show_bug.cgi?id=196395

r243512 modifes Intl.DateTimeFormat to obey 2-digit hour. A test was
added to test 2-digit hour in Russian using 12-hour setting as true and
false. In the former case, the expected string appends the string 'AM'
in Russian. This localised string made GTK-based ports fail since
according to Glib the 'am_pm' values in Russian are not localised.

This patch keeps the same test but changes locale to 'en' to prevent
the test from failing.

Reviewed by Michael Catanzaro.

  • js/intl-datetimeformat-expected.txt:
  • js/script-tests/intl-datetimeformat.js:
  • platform/gtk/js/intl-datetimeformat-expected.txt:
Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243737 r243740  
     12019-04-02  Diego Pino Garcia  <dpino@igalia.com>
     2
     3        REGRESSION(r243512): Change locale of test in intl-datetimeformat.js
     4        https://bugs.webkit.org/show_bug.cgi?id=196395
     5
     6        r243512 modifes Intl.DateTimeFormat to obey 2-digit hour. A test was
     7        added to test 2-digit hour in Russian using 12-hour setting as true and
     8        false. In the former case, the expected string appends the string 'AM'
     9        in Russian. This localised string made GTK-based ports fail since
     10        according to Glib the 'am_pm' values in Russian are not localised.
     11       
     12        This patch keeps the same test but changes locale to 'en' to prevent
     13        the test from failing.
     14
     15        Reviewed by Michael Catanzaro.
     16
     17        * js/intl-datetimeformat-expected.txt:
     18        * js/script-tests/intl-datetimeformat.js:
     19        * platform/gtk/js/intl-datetimeformat-expected.txt:
     20
    1212019-04-01  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/LayoutTests/js/intl-datetimeformat-expected.txt

    r243512 r243740  
    322322PASS Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hour12 is false
    323323PASS Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric', timeZone: 'UTC' }).format(0) is '0:00'
    324 PASS Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: false, timeZone: 'UTC' }).format(0) is '00:00'
    325 PASS Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7) is '02:46 ДП'
     324PASS Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit', hour12: false, timeZone: 'UTC' }).format(0) is '00:00'
     325PASS Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7) is '02:46 AM'
    326326PASS Intl.DateTimeFormat('en', { minute: { toString() { throw 'minute' } } }) threw exception minute.
    327327PASS Intl.DateTimeFormat('en', { minute:null }) threw exception RangeError: minute must be "2-digit" or "numeric".
  • trunk/LayoutTests/js/script-tests/intl-datetimeformat.js

    r243512 r243740  
    436436shouldBe("Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hour12", "false");
    437437shouldBe("Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric', timeZone: 'UTC' }).format(0)", "'0:00'");
    438 shouldBe("Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: false, timeZone: 'UTC' }).format(0)", "'00:00'");
    439 shouldBe("Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7)", "'02:46 ДП'");
     438shouldBe("Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit', hour12: false, timeZone: 'UTC' }).format(0)", "'00:00'");
     439shouldBe("Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7)", "'02:46 AM'");
    440440
    441441shouldThrow("Intl.DateTimeFormat('en', { minute: { toString() { throw 'minute' } } })", "'minute'");
  • trunk/LayoutTests/platform/gtk/js/intl-datetimeformat-expected.txt

    r243594 r243740  
    322322PASS Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric' }).resolvedOptions().hour12 is false
    323323PASS Intl.DateTimeFormat('pt-BR', { minute:'2-digit', hour:'numeric', timeZone: 'UTC' }).format(0) is '0:00'
    324 PASS Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: false, timeZone: 'UTC' }).format(0) is '00:00'
    325 FAIL Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7) should be 02:46 ДП. Was 02:46 AM.
     324PASS Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit', hour12: false, timeZone: 'UTC' }).format(0) is '00:00'
     325PASS Intl.DateTimeFormat('en', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7) is '02:46 AM'
    326326PASS Intl.DateTimeFormat('en', { minute: { toString() { throw 'minute' } } }) threw exception minute.
    327327PASS Intl.DateTimeFormat('en', { minute:null }) threw exception RangeError: minute must be "2-digit" or "numeric".
Note: See TracChangeset for help on using the changeset viewer.