Changeset 259480 in webkit


Ignore:
Timestamp:
Apr 3, 2020 11:34:53 AM (4 years ago)
Author:
Ross Kirsling
Message:

Move Intl tests from LayoutTests to JSTests
https://bugs.webkit.org/show_bug.cgi?id=209922

Reviewed by Yusuke Suzuki.

JSTests:

Intl doesn't depend on WebCore, so these tests shouldn't be layout tests.
(They do, however, require one method to be added to $vm.)

Since LayoutTests/js has its own test harness, I've also migrated each test case to use simpler assertions.

  • stress/array-to-locale-string.js: Removed -- subsumed by the following test.
  • stress/array-toLocaleString.js: Added.
  • stress/date-toLocaleString.js: Added.
  • stress/intl-collator.js: Added.
  • stress/intl-datetimeformat.js: Added.
  • stress/intl-default-locale.js: Added.
  • stress/intl-numberformat-format-to-parts.js: Added.
  • stress/intl-numberformat.js: Added.
  • stress/intl-object.js: Added.
  • stress/intl-pluralrules.js: Added.
  • stress/number-toLocaleString.js: Added.
  • stress/string-localeCompare.js: Added.
  • stress/string-toLocaleLowerCase.js: Added.
  • stress/string-toLocaleUpperCase.js: Added.

Source/JavaScriptCore:

  • tools/JSDollarVM.cpp:

(JSC::functionSetUserPreferredLanguages):
(JSC::JSDollarVM::finishCreation):
Add $vm.setUserPreferredLanguages, as needed by stress/intl-default-locale.js.

LayoutTests:

  • js/array-toLocaleString-expected.txt: Removed.
  • js/array-toLocaleString.html: Removed.
  • js/date-toLocaleString-expected.txt: Removed.
  • js/date-toLocaleString.html: Removed.
  • js/intl-collator-expected.txt: Removed.
  • js/intl-collator.html: Removed.
  • js/intl-datetimeformat-expected.txt: Removed.
  • js/intl-datetimeformat.html: Removed.
  • js/intl-default-locale-expected.txt: Removed.
  • js/intl-default-locale.html: Removed.
  • js/intl-expected.txt: Removed.
  • js/intl-numberformat-expected.txt: Removed.
  • js/intl-numberformat-format-to-parts-expected.txt: Removed.
  • js/intl-numberformat-format-to-parts.html: Removed.
  • js/intl-numberformat.html: Removed.
  • js/intl-pluralrules-expected.txt: Removed.
  • js/intl-pluralrules.html: Removed.
  • js/intl.html: Removed.
  • js/number-toLocaleString-expected.txt: Removed.
  • js/number-toLocaleString.html: Removed.
  • js/script-tests/array-toLocaleString.js: Removed.
  • js/script-tests/date-toLocaleString.js: Removed.
  • js/script-tests/intl-collator.js: Removed.
  • js/script-tests/intl-datetimeformat.js: Removed.
  • js/script-tests/intl-numberformat-format-to-parts.js: Removed.
  • js/script-tests/intl-numberformat.js: Removed.
  • js/script-tests/intl-pluralrules.js: Removed.
  • js/script-tests/intl.js: Removed.
  • js/script-tests/number-toLocaleString.js: Removed.
  • js/script-tests/string-localeCompare.js: Removed.
  • js/script-tests/string-toLocaleLowerCase.js: Removed.
  • js/script-tests/string-toLocaleUpperCase.js: Removed.
  • js/string-localeCompare-expected.txt: Removed.
  • js/string-localeCompare.html: Removed.
  • js/string-toLocaleLowerCase-expected.txt: Removed.
  • js/string-toLocaleLowerCase.html: Removed.
  • js/string-toLocaleUpperCase-expected.txt: Removed.
  • js/string-toLocaleUpperCase.html: Removed.
  • platform/ios-simulator/TestExpectations: Removed expectations.
  • platform/ios/TestExpectations: Removed expectations.
  • platform/mac/TestExpectations: Removed expectations.
  • platform/win/TestExpectations: Removed expectations.
Location:
trunk
Files:
13 added
39 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r259478 r259480  
     12020-04-03  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        Move Intl tests from LayoutTests to JSTests
     4        https://bugs.webkit.org/show_bug.cgi?id=209922
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Intl doesn't depend on WebCore, so these tests shouldn't be layout tests.
     9        (They do, however, require one method to be added to $vm.)
     10
     11        Since LayoutTests/js has its own test harness, I've also migrated each test case to use simpler assertions.
     12
     13        * stress/array-to-locale-string.js: Removed -- subsumed by the following test.
     14        * stress/array-toLocaleString.js: Added.
     15        * stress/date-toLocaleString.js: Added.
     16        * stress/intl-collator.js: Added.
     17        * stress/intl-datetimeformat.js: Added.
     18        * stress/intl-default-locale.js: Added.
     19        * stress/intl-numberformat-format-to-parts.js: Added.
     20        * stress/intl-numberformat.js: Added.
     21        * stress/intl-object.js: Added.
     22        * stress/intl-pluralrules.js: Added.
     23        * stress/number-toLocaleString.js: Added.
     24        * stress/string-localeCompare.js: Added.
     25        * stress/string-toLocaleLowerCase.js: Added.
     26        * stress/string-toLocaleUpperCase.js: Added.
     27
    1282020-04-03  Yusuke Suzuki  <ysuzuki@apple.com>
    229
  • trunk/LayoutTests/ChangeLog

    r259477 r259480  
     12020-04-03  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        Move Intl tests from LayoutTests to JSTests
     4        https://bugs.webkit.org/show_bug.cgi?id=209922
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * js/array-toLocaleString-expected.txt: Removed.
     9        * js/array-toLocaleString.html: Removed.
     10        * js/date-toLocaleString-expected.txt: Removed.
     11        * js/date-toLocaleString.html: Removed.
     12        * js/intl-collator-expected.txt: Removed.
     13        * js/intl-collator.html: Removed.
     14        * js/intl-datetimeformat-expected.txt: Removed.
     15        * js/intl-datetimeformat.html: Removed.
     16        * js/intl-default-locale-expected.txt: Removed.
     17        * js/intl-default-locale.html: Removed.
     18        * js/intl-expected.txt: Removed.
     19        * js/intl-numberformat-expected.txt: Removed.
     20        * js/intl-numberformat-format-to-parts-expected.txt: Removed.
     21        * js/intl-numberformat-format-to-parts.html: Removed.
     22        * js/intl-numberformat.html: Removed.
     23        * js/intl-pluralrules-expected.txt: Removed.
     24        * js/intl-pluralrules.html: Removed.
     25        * js/intl.html: Removed.
     26        * js/number-toLocaleString-expected.txt: Removed.
     27        * js/number-toLocaleString.html: Removed.
     28        * js/script-tests/array-toLocaleString.js: Removed.
     29        * js/script-tests/date-toLocaleString.js: Removed.
     30        * js/script-tests/intl-collator.js: Removed.
     31        * js/script-tests/intl-datetimeformat.js: Removed.
     32        * js/script-tests/intl-numberformat-format-to-parts.js: Removed.
     33        * js/script-tests/intl-numberformat.js: Removed.
     34        * js/script-tests/intl-pluralrules.js: Removed.
     35        * js/script-tests/intl.js: Removed.
     36        * js/script-tests/number-toLocaleString.js: Removed.
     37        * js/script-tests/string-localeCompare.js: Removed.
     38        * js/script-tests/string-toLocaleLowerCase.js: Removed.
     39        * js/script-tests/string-toLocaleUpperCase.js: Removed.
     40        * js/string-localeCompare-expected.txt: Removed.
     41        * js/string-localeCompare.html: Removed.
     42        * js/string-toLocaleLowerCase-expected.txt: Removed.
     43        * js/string-toLocaleLowerCase.html: Removed.
     44        * js/string-toLocaleUpperCase-expected.txt: Removed.
     45        * js/string-toLocaleUpperCase.html: Removed.
     46        * platform/ios-simulator/TestExpectations: Removed expectations.
     47        * platform/ios/TestExpectations: Removed expectations.
     48        * platform/mac/TestExpectations: Removed expectations.
     49        * platform/win/TestExpectations: Removed expectations.
     50
    1512020-04-03  Eric Carlson  <eric.carlson@apple.com>
    252
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r258875 r259480  
    8383imported/w3c/web-platform-tests/wasm/wasm_stream_compile_test.html  [ Skip ]
    8484
    85 # macOS doesn't have ICU v59
    86 webkit.org/b/185375 js/intl-numberformat-format-to-parts.html [ Failure ]
    87 
    8885# Imported css-text test suite from WPT
    8986webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/white-space/textarea-pre-wrap-001.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/ios/TestExpectations

    r259377 r259480  
    32453245media/video-played-reset.html [ Failure ]
    32463246
    3247 # <rdar://problem/51055223> (iOS 13): jsc-layout-tests.yaml/js/script-tests/intl-numberformat.js.layout is failing
    3248 js/intl-numberformat.html [ Failure ]
    3249 
    32503247# <rdar://problem/50892567> REGRESSION (iOS 13): CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebKit: _ZN6WebKit19fallbackIconForFileEP5NSURL
    32513248fast/forms/file/file-reset-in-change-using-open-panel-with-icon.html [ Skip ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r259438 r259480  
    15651565webkit.org/b/185659 [ Debug ] animations/needs-layout.html [ Pass ImageOnlyFailure ]
    15661566
    1567 # macOS doesn't have ICU v59
    1568 webkit.org/b/185375 js/intl-numberformat-format-to-parts.html [ Failure ]
    1569 
    15701567# Imported css-text test suite from WPT
    15711568webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/i18n/css3-text-line-break-opclns-010.html [ ImageOnlyFailure ]
     
    17181715# <rdar://problem/50383285>
    17191716[ Catalina+ ] imported/w3c/web-platform-tests/css/css-text/writing-system/writing-system-line-break-001.html [ ImageOnlyFailure ]
    1720 
    1721 # <rdar://problem/51055223>
    1722 [ Catalina+ ] js/intl-numberformat.html [ Failure ]
    17231717
    17241718# <rdar://problem/51762717>
  • trunk/LayoutTests/platform/win/TestExpectations

    r259055 r259480  
    24862486# The following fails due to DOM exception 18.
    24872487js/dom/callback-function-with-handle-event.html [ Skip ] #  [ Timeout ]
    2488 
    2489 # Skip INTL related tests since AppleWin currently does not have INTL enabled.
    2490 js/array-toLocaleString.html [ Skip ]
    2491 js/date-toLocaleString.html [ Skip ]
    2492 js/intl-collator.html [ Skip ]
    2493 js/intl-datetimeformat.html [ Skip ]
    2494 js/intl-default-locale.html [ Skip ]
    2495 js/intl-numberformat.html [ Skip ]
    2496 js/intl-numberformat-format-to-parts.html [ Skip ]
    2497 js/intl-pluralrules.html [ Skip ]
    2498 js/intl.html [ Skip ]
    2499 js/number-toLocaleString.html [ Skip ]
    2500 js/string-localeCompare.html [ Skip ]
    2501 js/string-toLocaleLowerCase.html [ Skip ]
    2502 js/string-toLocaleUpperCase.html [ Skip ]
    25032488
    25042489webkit.org/b/151027 jquery/manipulation.html [ Pass Timeout ]
  • trunk/Source/JavaScriptCore/ChangeLog

    r259479 r259480  
     12020-04-03  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        Move Intl tests from LayoutTests to JSTests
     4        https://bugs.webkit.org/show_bug.cgi?id=209922
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        * tools/JSDollarVM.cpp:
     9        (JSC::functionSetUserPreferredLanguages):
     10        (JSC::JSDollarVM::finishCreation):
     11        Add $vm.setUserPreferredLanguages, as needed by stress/intl-default-locale.js.
     12
    1132020-04-03  Devin Rousso  <drousso@apple.com>
    214
  • trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp

    r259463 r259480  
    5757#include <wtf/CPUTime.h>
    5858#include <wtf/DataLog.h>
     59#include <wtf/Language.h>
    5960#include <wtf/ProcessID.h>
    6061#include <wtf/StringPrintStream.h>
     
    29382939}
    29392940
     2941static EncodedJSValue JSC_HOST_CALL functionSetUserPreferredLanguages(JSGlobalObject* globalObject, CallFrame* callFrame)
     2942{
     2943    VM& vm = globalObject->vm();
     2944    auto scope = DECLARE_THROW_SCOPE(vm);
     2945
     2946    JSArray* array = jsDynamicCast<JSArray*>(vm, callFrame->argument(0));
     2947    if (!array)
     2948        return throwVMTypeError(globalObject, scope, "Expected first argument to be an array"_s);
     2949
     2950    Vector<String> languages;
     2951    unsigned length = array->length();
     2952    for (size_t i = 0; i < length; i++) {
     2953        String language = array->get(globalObject, i).toWTFString(globalObject);
     2954        RETURN_IF_EXCEPTION(scope, encodedJSValue());
     2955        languages.append(language);
     2956    }
     2957
     2958    overrideUserPreferredLanguages(languages);
     2959    return JSValue::encode(jsUndefined());
     2960}
     2961
    29402962void JSDollarVM::finishCreation(VM& vm)
    29412963{
     
    30743096    addFunction(vm, "rejectPromiseAsHandled", functionRejectPromiseAsHandled, 1);
    30753097
     3098    addFunction(vm, "setUserPreferredLanguages", functionSetUserPreferredLanguages, 1);
     3099
    30763100    m_objectDoingSideEffectPutWithoutCorrectSlotStatusStructure.set(vm, this, ObjectDoingSideEffectPutWithoutCorrectSlotStatus::createStructure(vm, globalObject, jsNull()));
    30773101}
Note: See TracChangeset for help on using the changeset viewer.