Changeset 138836 in webkit


Ignore:
Timestamp:
Jan 4, 2013 12:42:37 PM (11 years ago)
Author:
jsbell@chromium.org
Message:

Add tests for WebIDL type conversions
https://bugs.webkit.org/show_bug.cgi?id=105927

Reviewed by Adam Barth.

Source/WebCore:

Expose attributes of various WebIDL types for testing ECMAScript value conversion,
including edge cases such as NaNs, Infinities, etc. These attributes hang off
a TypeConversions object created via window.internals.typeConversions().

Test: fast/js/webidl-type-mapping.html

  • CMakeLists.txt:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gyp/WebCore.gyp:
  • WebCore.gypi:
  • WebCore.vcproj/WebCoreTestSupport.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • testing/Internals.cpp:

(WebCore::Internals::typeConversions):
(WebCore):

  • testing/Internals.h:

(WebCore):

  • testing/Internals.idl:
  • testing/TypeConversions.h: Added.

(WebCore):
(TypeConversions):
(WebCore::TypeConversions::create):
(WebCore::TypeConversions::testLong):
(WebCore::TypeConversions::setTestLong):
(WebCore::TypeConversions::testUnsignedLong):
(WebCore::TypeConversions::setTestUnsignedLong):
(WebCore::TypeConversions::testLongLong):
(WebCore::TypeConversions::setTestLongLong):
(WebCore::TypeConversions::testUnsignedLongLong):
(WebCore::TypeConversions::setTestUnsignedLongLong):
(WebCore::TypeConversions::TypeConversions):

  • testing/TypeConversions.idl: Added.

LayoutTests:

This currently fails long long conversions of non-finites (which should map to 0). Patch
in progress at: http://wkbug.com/96798

  • fast/js/webidl-type-mapping-expected.txt: Added.
  • fast/js/webidl-type-mapping.html: Added.
Location:
trunk
Files:
4 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138835 r138836  
     12013-01-04  Joshua Bell  <jsbell@chromium.org>
     2
     3        Add tests for WebIDL type conversions
     4        https://bugs.webkit.org/show_bug.cgi?id=105927
     5
     6        Reviewed by Adam Barth.
     7
     8        This currently fails long long conversions of non-finites (which should map to 0). Patch
     9        in progress at: http://wkbug.com/96798
     10
     11        * fast/js/webidl-type-mapping-expected.txt: Added.
     12        * fast/js/webidl-type-mapping.html: Added.
     13
    1142013-01-04  Stephen White  <senorblanco@chromium.org>
    215
  • trunk/Source/WebCore/CMakeLists.txt

    r138727 r138836  
    27612761    testing/InternalSettings.idl
    27622762    testing/MallocStatistics.idl
     2763    testing/TypeConversions.idl
    27632764)
    27642765
  • trunk/Source/WebCore/ChangeLog

    r138835 r138836  
     12013-01-04  Joshua Bell  <jsbell@chromium.org>
     2
     3        Add tests for WebIDL type conversions
     4        https://bugs.webkit.org/show_bug.cgi?id=105927
     5
     6        Reviewed by Adam Barth.
     7
     8        Expose attributes of various WebIDL types for testing ECMAScript value conversion,
     9        including edge cases such as NaNs, Infinities, etc. These attributes hang off
     10        a TypeConversions object created via window.internals.typeConversions().
     11
     12        Test: fast/js/webidl-type-mapping.html
     13
     14        * CMakeLists.txt:
     15        * DerivedSources.make:
     16        * DerivedSources.pri:
     17        * GNUmakefile.list.am:
     18        * Target.pri:
     19        * WebCore.gyp/WebCore.gyp:
     20        * WebCore.gypi:
     21        * WebCore.vcproj/WebCoreTestSupport.vcproj:
     22        * WebCore.xcodeproj/project.pbxproj:
     23        * testing/Internals.cpp:
     24        (WebCore::Internals::typeConversions):
     25        (WebCore):
     26        * testing/Internals.h:
     27        (WebCore):
     28        * testing/Internals.idl:
     29        * testing/TypeConversions.h: Added.
     30        (WebCore):
     31        (TypeConversions):
     32        (WebCore::TypeConversions::create):
     33        (WebCore::TypeConversions::testLong):
     34        (WebCore::TypeConversions::setTestLong):
     35        (WebCore::TypeConversions::testUnsignedLong):
     36        (WebCore::TypeConversions::setTestUnsignedLong):
     37        (WebCore::TypeConversions::testLongLong):
     38        (WebCore::TypeConversions::setTestLongLong):
     39        (WebCore::TypeConversions::testUnsignedLongLong):
     40        (WebCore::TypeConversions::setTestUnsignedLongLong):
     41        (WebCore::TypeConversions::TypeConversions):
     42        * testing/TypeConversions.idl: Added.
     43
    1442013-01-04  Stephen White  <senorblanco@chromium.org>
    245
  • trunk/Source/WebCore/DerivedSources.make

    r138727 r138836  
    600600    $(WebCore)/testing/InternalSettings.idl \
    601601    $(WebCore)/testing/MallocStatistics.idl \
     602    $(WebCore)/testing/TypeConversions.idl \
    602603    $(WebCore)/workers/AbstractWorker.idl \
    603604    $(WebCore)/workers/DedicatedWorkerContext.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r138727 r138836  
    460460    $$PWD/testing/InternalSettings.idl \
    461461    $$PWD/testing/MallocStatistics.idl \
     462    $$PWD/testing/TypeConversions.idl \
    462463    $$PWD/workers/AbstractWorker.idl \
    463464    $$PWD/workers/DedicatedWorkerContext.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r138730 r138836  
    17391739        $(WebCore)/testing/InternalSettings.idl \
    17401740        $(WebCore)/testing/MallocStatistics.idl \
     1741        $(WebCore)/testing/TypeConversions.idl \
    17411742        $(WebCore)/workers/AbstractWorker.idl \
    17421743        $(WebCore)/workers/DedicatedWorkerContext.idl \
  • trunk/Source/WebCore/Target.pri

    r138730 r138836  
    27762776    testing/InternalSettings.h \
    27772777    testing/MallocStatistics.h \
     2778    testing/TypeConversions.h \
    27782779    workers/AbstractWorker.h \
    27792780    workers/DedicatedWorkerContext.h \
  • trunk/Source/WebCore/WebCore.gyp/WebCore.gyp

    r138727 r138836  
    22542254        '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8MallocStatistics.cpp',
    22552255        '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8MallocStatistics.h',
     2256        '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8TypeConversions.cpp',
     2257        '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8TypeConversions.h',
    22562258        '<(SHARED_INTERMEDIATE_DIR)/webcore/bindings/V8Internals.cpp',
    22572259        '<(SHARED_INTERMEDIATE_DIR)/webkit/bindings/V8Internals.h',
  • trunk/Source/WebCore/WebCore.gypi

    r138727 r138836  
    50645064          'testing/InternalSettings.idl',
    50655065          'testing/MallocStatistics.idl',
     5066          'testing/TypeConversions.idl',
    50665067          '<(SHARED_INTERMEDIATE_DIR)/webkit/InternalSettingsGenerated.idl',
    50675068        ],
     
    50805081            'testing/MockPagePopupDriver.cpp',
    50815082            'testing/MockPagePopupDriver.h',
     5083            'testing/TypeConversions.h',
    50825084            '<(SHARED_INTERMEDIATE_DIR)/webkit/InternalSettingsGenerated.cpp',
    50835085            '<(SHARED_INTERMEDIATE_DIR)/webkit/InternalSettingsGenerated.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCoreTestSupport.vcproj

    r138727 r138836  
    697697                        </File>
    698698                        <File
     699                                RelativePath="..\testing\TypeConversions.h"
     700                                >
     701                        </File>
     702                        <File
    699703                                RelativePath="..\testing\Internals.cpp"
    700704                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r138730 r138836  
    39013901                A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4EA6914C9348400C8F5BF /* JSMallocStatistics.h */; };
    39023902                A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B4EA6814C9348400C8F5BF /* JSMallocStatistics.cpp */; };
     3903                EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF5121B1696496C0056BD25 /* JSTypeConversions.h */; };
     3904                EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF5121A1696496C0056BD25 /* JSTypeConversions.cpp */; };
    39033905                A740B5A514C935AB00A77FA4 /* JSInternalSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B4EA7914C9348400C8F5BF /* JSInternalSettings.h */; };
    39043906                A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7B4EA7814C9348400C8F5BF /* JSInternalSettings.cpp */; };
     
    1130911311                A7B4EA6814C9348400C8F5BF /* JSMallocStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMallocStatistics.cpp; sourceTree = "<group>"; };
    1131011312                A7B4EA6914C9348400C8F5BF /* JSMallocStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMallocStatistics.h; sourceTree = "<group>"; };
     11313                EBF5121A1696496C0056BD25 /* JSTypeConversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTypeConversions.cpp; sourceTree = "<group>"; };
     11314                EBF5121B1696496C0056BD25 /* JSTypeConversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTypeConversions.h; sourceTree = "<group>"; };
    1131111315                A7B4EA7814C9348400C8F5BF /* JSInternalSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInternalSettings.cpp; sourceTree = "<group>"; };
    1131211316                A7B4EA7914C9348400C8F5BF /* JSInternalSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInternalSettings.h; sourceTree = "<group>"; };
     
    1380513809                E55F4979151B888000BB67DB /* LengthFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthFunctions.cpp; sourceTree = "<group>"; };
    1380613810                E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthFunctions.h; sourceTree = "<group>"; };
     13811                EB081CD81696084400553730 /* TypeConversions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypeConversions.h; sourceTree = "<group>"; };
     13812                EB081CD91696084400553730 /* TypeConversions.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = TypeConversions.idl; sourceTree = "<group>"; };
    1380713813                ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarker.h; sourceTree = "<group>"; };
    1380813814                ED501DC50B249F2900AE18D9 /* EditorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = EditorMac.mm; path = mac/EditorMac.mm; sourceTree = "<group>"; };
     
    1532615332                                A7BE7EDD14C9175A0014489D /* MallocStatistics.h */,
    1532715333                                A7BE7EDE14C9175A0014489D /* MallocStatistics.idl */,
     15334                                EB081CD81696084400553730 /* TypeConversions.h */,
     15335                                EB081CD91696084400553730 /* TypeConversions.idl */,
    1532815336                        );
    1532915337                        path = testing;
     
    1534115349                                A7B4EA6814C9348400C8F5BF /* JSMallocStatistics.cpp */,
    1534215350                                A7B4EA6914C9348400C8F5BF /* JSMallocStatistics.h */,
     15351                                EBF5121A1696496C0056BD25 /* JSTypeConversions.cpp */,
     15352                                EBF5121B1696496C0056BD25 /* JSTypeConversions.h */,
    1534315353                        );
    1534415354                        name = Testing;
     
    2265822668                                A740B5A514C935AB00A77FA4 /* JSInternalSettings.h in Headers */,
    2265922669                                A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */,
     22670                                EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */,
    2266022671                                41815C1F138319830057AAA4 /* WebCoreTestSupport.h in Headers */,
    2266122672                                53ED3FDF167A88E7006762E6 /* JSInternalSettingsGenerated.h in Headers */,
     
    2634726358                                A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */,
    2634826359                                A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */,
     26360                                EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
    2634926361                                41815C1E138319830057AAA4 /* WebCoreTestSupport.cpp in Sources */,
    2635026362                                53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */,
  • trunk/Source/WebCore/testing/Internals.cpp

    r138632 r138836  
    8484#include "TextIterator.h"
    8585#include "TreeScope.h"
     86#include "TypeConversions.h"
    8687#include "ViewportArguments.h"
    8788#include <wtf/text/StringBuffer.h>
     
    17021703{
    17031704    return MallocStatistics::create();
     1705}
     1706
     1707PassRefPtr<TypeConversions> Internals::typeConversions() const
     1708{
     1709    return TypeConversions::create();
    17041710}
    17051711
  • trunk/Source/WebCore/testing/Internals.h

    r138632 r138836  
    5656class MallocStatistics;
    5757class SerializedScriptValue;
     58class TypeConversions;
    5859
    5960typedef int ExceptionCode;
     
    257258
    258259    PassRefPtr<MallocStatistics> mallocStatistics() const;
     260    PassRefPtr<TypeConversions> typeConversions() const;
    259261
    260262    PassRefPtr<DOMStringList> getReferencedFilePaths() const;
  • trunk/Source/WebCore/testing/Internals.idl

    r138632 r138836  
    221221
    222222    MallocStatistics mallocStatistics();
     223    TypeConversions typeConversions();
    223224
    224225    DOMString[] getReferencedFilePaths();
Note: See TracChangeset for help on using the changeset viewer.