Reviewed by Darin Adler.
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Mar 2010 19:15:20 +0000 (19:15 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Mar 2010 19:15:20 +0000 (19:15 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=35617
        Import Mozilla LiveConnect 3 test suite

        * java/lc3/sources: Added (many files). Sources for Mozilla test applet.

        * java/jstests.jar: Added in compiled form, since it's unlikely that we'll ever need to
        modify the above sources.

        * java/lc3.java: Added.
        (lc3): This is a small wrapper around jstests.jar. The latter only adds some classes, but
        WebKit needs an actual applet to call into Java.
        (lc3.createQAObject): Instantiate a class defined in jstests.jar by name.
        (lc3.stringToByteArray): A helper to make a byte array out of string. Tests originally
        relied on window.java package interface to do this, but it's not available in WebKit. We
        need more functions like this to work around other uses of window.java, but this is one I
        wrote for now.

        * java/Makefile: Link test applets to Mozilla's jstests.jar. This is not needed for tests
        other than ones imported here, but it's also harmless, and I don't know how to write good
        makefiles.

        * java/lc3: Added (many files). Tests were heavily reworked to run to completion, but PASS/FAIL
        results should not be generally relied upon. All html wrappers are identical.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55469 268f45cc-cd09-0410-ab3c-d52691b4dbfc

655 files changed:
LayoutTests/ChangeLog
LayoutTests/java/Makefile
LayoutTests/java/jstests.jar [new file with mode: 0644]
LayoutTests/java/lc3.java [new file with mode: 0644]
LayoutTests/java/lc3/ArrayMethods/byte-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ArrayMethods/byte-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ArrayMethods/byte-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ArrayMethods/byte-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ArrayMethods/byte-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ArrayMethods/byte-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ArrayMethods/object-001.html-disabled [new file with mode: 0644]
LayoutTests/java/lc3/ArrayMethods/object-001.js [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/boolean-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/boolean-001.html [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/boolean-001.js [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/number-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/number-001.html [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/number-001.js [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/object-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/object-001.html [new file with mode: 0644]
LayoutTests/java/lc3/CallStatic/object-001.js [new file with mode: 0644]
LayoutTests/java/lc3/Constructors/construct-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/Constructors/construct-001.html [new file with mode: 0644]
LayoutTests/java/lc3/Constructors/construct-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-003-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-003.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-003.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-004-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-004.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-004.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-006-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-006-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-006-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-007-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-007-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-007-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-008-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-008-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-008-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-009-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-009-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-009-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-010-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-010-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-010-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-011-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-011-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-011-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-012-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-012-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-012-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-013-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-013-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-013-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-014-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-014.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertBoolean/boolean-014.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToByte-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToByte-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToByte-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToByte-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToByte-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToByte-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToChar-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToChar-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToChar-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToChar-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToChar-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToChar-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToDouble-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToDouble-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToDouble-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToFloat-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToFloat-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToFloat-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToInt-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToInt-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToInt-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToInt-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToInt-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToInt-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToJSObject-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToJSObject-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToJSObject-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToLong-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToLong-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToLong-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToLong-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToLong-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToLong-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToObject-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToObject-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToObject-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToShort-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToShort-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToShort-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToShort-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToShort-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToShort-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToString-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToString-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertJSObject/ToString-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-005-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-005.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-005.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-006-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-006-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNull/null-006-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-003-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-003.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-003.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-004-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-004.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-004.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-005-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-005.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-005.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-006-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-006.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-006.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-007-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-007.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-007.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-008-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-008.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-008.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-009-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-009.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-009.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-010-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-010.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-010.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-011-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-011.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertNumber/number-011.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-001.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-001.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-003-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-003.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-003.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-006-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-006.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-006.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-007-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-007-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertString/string-007-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-001-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-001-n.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-001-n.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-002.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-002.js [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-003-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-003.html [new file with mode: 0644]
LayoutTests/java/lc3/ConvertUndefined/undefined-003.js [new file with mode: 0644]
LayoutTests/java/lc3/Exceptions/throw_js_types-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/Exceptions/throw_js_types.html [new file with mode: 0644]
LayoutTests/java/lc3/Exceptions/throw_js_types.js [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-006-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-006-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-006-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-007-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-007-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-007-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-008-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-008-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSBoolean/boolean-008-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToBoolean-001-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToBoolean-001-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToBoolean-001-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToFloat-001-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToFloat-001-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToFloat-001-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToLong-001-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToLong-001-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToLong-001-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToNumber-001-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToNumber-001-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToNumber-001-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToObject-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToObject-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNull/ToObject-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-004-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-004.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-004.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToByte-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-004-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-004.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-004.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-006-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-006-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToChar-006-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-002.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-002.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-003-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-003.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToDouble-003.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-004-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-004.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-004.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToInt-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-006-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-006-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-006-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-007-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-007-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-007-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-008-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-008-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-008-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-009-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-009-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-009-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-010-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-010-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-010-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-011-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-011-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToLong-011-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-004-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-004.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-004.js [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSNumber/ToShort-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToByte-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToByte-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToByte-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToChar-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToChar-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToChar-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToDouble-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToFloat-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToInt-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToInt-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToInt-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToInt-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToInt-002.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToInt-002.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToJSObject-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToJSObject-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToJSObject-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToLong-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToLong-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToLong-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToObject-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToObject-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToObject-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToShort-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToShort-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToShort-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToString-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToString-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSObject/ToString-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-006-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-006-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-006-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-007-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-007-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-007-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-008-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-008-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-008-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-009-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-009-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-009-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-010-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-010-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JSUndefined/undefined-010-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToArray-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToArray-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToArray-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToArray-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToArray-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToArray-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToBoolean-001-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToBoolean-001-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToBoolean-001-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToString-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToString-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaArray/ToString-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToClass-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToClass-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToClass-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToJSObject-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToJSObject-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToJSObject-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToObject-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToObject-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToObject-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToString-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToString-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaClass/ToString-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectBeanProps-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectBeanProps-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectBeanProps-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectFieldOrMethod-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectFieldOrMethod-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectFieldOrMethod-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToBoolean-001-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToBoolean-001-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToBoolean-001-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToBoolean-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToBoolean-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToBoolean-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-005-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-005.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-005.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-006-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-006.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-006.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-007-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-007-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-007-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-008-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-008-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToByte-008-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-002-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-002.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-002.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-004-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-004.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-004.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-005-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-005-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-005-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-006-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-006-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToChar-006-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToDouble-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToDouble-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToDouble-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToFloat-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToFloat-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToFloat-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToInt-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-005-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-005.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-005.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-006-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-006-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToLong-006-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-001.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-002-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-002-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-002-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-003-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-003-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-003-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-004-n-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-004-n.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-004-n.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-005-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-005.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-005.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-006-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-006.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToShort-006.js [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToString-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToString-001.html [new file with mode: 0644]
LayoutTests/java/lc3/JavaObject/JavaObjectToString-001.js [new file with mode: 0644]
LayoutTests/java/lc3/StringMethods/string-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/StringMethods/string-001.html [new file with mode: 0644]
LayoutTests/java/lc3/StringMethods/string-001.js [new file with mode: 0644]
LayoutTests/java/lc3/forin/array-001.html-disabled [new file with mode: 0644]
LayoutTests/java/lc3/forin/array-001.js [new file with mode: 0644]
LayoutTests/java/lc3/forin/object-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/forin/object-001.html [new file with mode: 0644]
LayoutTests/java/lc3/forin/object-001.js [new file with mode: 0644]
LayoutTests/java/lc3/instanceof/instanceof-001-expected.txt [new file with mode: 0644]
LayoutTests/java/lc3/instanceof/instanceof-001.html [new file with mode: 0644]
LayoutTests/java/lc3/instanceof/instanceof-001.js [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/LiveConnectDrv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/LiveConnectEnv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/LiveNavDrv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/LiveNavEnv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/MacRefDrv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/MacRefEnv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/NavDrv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/NavEnv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/ObservedTask.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/RefDrv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/RefEnv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/RhinoDrv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/RhinoEnv.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/TestCase.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/TestDriver.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/TestEnvironment.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/TestFile.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/TestLog.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/drivers/TestSuite.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_002.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_003.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_004.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_005.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_006.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_007.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_008.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_009.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_010.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/bool/Boolean_011.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsnull/Null_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_002.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_003.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_004.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_005.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_006.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_007.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_008.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_009.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/jsobject/JSObject_010.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_002.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_003.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_004.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_005.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_006.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_007.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_008.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_009.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/number/Number_010.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/string/String_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/string/String_002.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/string/String_003.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/string/String_004.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/string/String_005.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/lc3/undefined/Undefined_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/DataTypeClass.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/JSObjectConversion.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/JSObjectEval.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/LiveConnectTest.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/call/Call_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_002.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_003.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_004.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_005.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_006.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_007.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_008.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_009.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_010.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_011.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_012.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_013.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_014.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_015.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_016.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_017.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_018.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/datatypes/DataTypes_019.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/exception/Exception_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/jsobject/JSObject_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/member/Member_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/member/Member_002.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/slot/Slot_001.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/slot/Slot_002.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/slot/Slot_003.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/slot/Slot_004.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/slot/Slot_005.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/slot/Slot_006.java [new file with mode: 0644]
LayoutTests/java/lc3/sources/com/netscape/javascript/qa/liveconnect/tostring/ToString_001.java [new file with mode: 0644]

index 0e48545..8005e95 100644 (file)
@@ -1,3 +1,31 @@
+2010-03-03  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35617
+        Import Mozilla LiveConnect 3 test suite
+
+        * java/lc3/sources: Added (many files). Sources for Mozilla test applet.
+
+        * java/jstests.jar: Added in compiled form, since it's unlikely that we'll ever need to
+        modify the above sources.
+
+        * java/lc3.java: Added.
+        (lc3): This is a small wrapper around jstests.jar. The latter only adds some classes, but
+        WebKit needs an actual applet to call into Java.
+        (lc3.createQAObject): Instantiate a class defined in jstests.jar by name.
+        (lc3.stringToByteArray): A helper to make a byte array out of string. Tests originally
+        relied on window.java package interface to do this, but it's not available in WebKit. We
+        need more functions like this to work around other uses of window.java, but this is one I
+        wrote for now.
+
+        * java/Makefile: Link test applets to Mozilla's jstests.jar. This is not needed for tests
+        other than ones imported here, but it's also harmless, and I don't know how to write good
+        makefiles.
+
+        * java/lc3: Added (many files). Tests were heavily reworked to run to completion, but PASS/FAIL
+        results should not be generally relied upon. All html wrappers are identical.
+
 2010-03-03  Eric Carlson  <eric.carlson@apple.com>
 
         Unreviewed, build fix.
index 6f27a16..b315e9e 100644 (file)
@@ -36,9 +36,9 @@ ifeq ($(USE_NORMAL_PLUGIN_JAR_PATH), 1)
        CLASSPATH = /System/Library/Frameworks/JavaVM.framework/Home/lib/plugin.jar
 else
        # The above path works on Tiger and Leopard, but is a broken link on SnowLeopard, <rdar://7578937>.
-    CLASSPATH := /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/Deploy.bundle/Contents/Resources/Java/plugin.jar
+    CLASSPATH = /System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/Deploy.bundle/Contents/Resources/Java/plugin.jar
 endif
-JFLAGS = -classpath $(CLASSPATH)
+JFLAGS = -classpath $(CLASSPATH):jstests.jar
 .SUFFIXES: .java .class
 
 .java.class:
diff --git a/LayoutTests/java/jstests.jar b/LayoutTests/java/jstests.jar
new file mode 100644 (file)
index 0000000..69bf706
Binary files /dev/null and b/LayoutTests/java/jstests.jar differ
diff --git a/LayoutTests/java/lc3.java b/LayoutTests/java/lc3.java
new file mode 100644 (file)
index 0000000..b65bfe7
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+import java.applet.Applet;
+import com.netscape.javascript.qa.liveconnect.*;
+import com.netscape.javascript.qa.lc3.bool.*;
+import com.netscape.javascript.qa.lc3.jsnull.*;
+import com.netscape.javascript.qa.lc3.jsobject.*;
+import com.netscape.javascript.qa.lc3.number.*;
+import com.netscape.javascript.qa.lc3.string.*;
+import com.netscape.javascript.qa.lc3.undefined.*;
+
+public class lc3 extends Applet {
+
+    public Object createQAObject(String name) throws Exception {
+        Class theClass  = Class.forName(name);
+        return theClass.newInstance();
+    }
+
+    public byte[] stringToByteArray(String string) {
+        return string.getBytes();
+    }
+}
diff --git a/LayoutTests/java/lc3/ArrayMethods/byte-001-expected.txt b/LayoutTests/java/lc3/ArrayMethods/byte-001-expected.txt
new file mode 100644 (file)
index 0000000..0e658ef
--- /dev/null
@@ -0,0 +1,18 @@
+LiveConnect 3.0 java array object inheritance JavaScript Array methods
+
+PASS b0 = wkTestStringToJavaByteArray("hello"); b0.join() +'' is "104,101,108,108,111"
+PASS b0.join == Array.prototype.join is true
+FAIL b0.getClass().getName() +'' should be [B. Threw exception TypeError: Result of expression 'b0.getClass' [undefined] is not a function.
+PASS b1 = wkTestStringToJavaByteArray("JavaScript"); b1.reverse().join() +'' is getCharValues("tpircSavaJ")
+PASS b1.reverse == Array.prototype.reverse is true
+FAIL b1.getClass().getName() +'' should be [B. Threw exception TypeError: Result of expression 'b1.getClass' [undefined] is not a function.
+PASS b2 = wkTestStringToJavaByteArray("JavaScript"); b2.sort().join() +'' is "105,112,114,116,118,74,83,97,97,99"
+PASS b2.sort == Array.prototype.sort is true
+FAIL b2.getClass().getName() +'' should be [B. Threw exception TypeError: Result of expression 'b2.getClass' [undefined] is not a function.
+PASS b3 = wkTestStringToJavaByteArray("JavaScript"); b3.sort().join() +'' is "105,112,114,116,118,74,83,97,97,99"
+PASS b3.sort == Array.prototype.sort is true
+FAIL b3.getClass().getName() +'' should be [B. Threw exception TypeError: Result of expression 'b3.getClass' [undefined] is not a function.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ArrayMethods/byte-001.html b/LayoutTests/java/lc3/ArrayMethods/byte-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ArrayMethods/byte-001.js b/LayoutTests/java/lc3/ArrayMethods/byte-001.js
new file mode 100644 (file)
index 0000000..3e79738
--- /dev/null
@@ -0,0 +1,107 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'byte-001.js';
+
+/**
+ *  java array objects "inherit" JS string methods.  verify that byte arrays
+ *  can inherit JavaScript Array object methods
+ *
+ *
+ */
+var SECTION = "java array object inheritance JavaScript Array methods";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 " + SECTION;
+
+startTest();
+
+var a = new Array();
+
+a[a.length] = new TestObject(
+  "b"+a.length+" = wkTestStringToJavaByteArray(\"hello\"); b"+a.length+".join() +''",
+  "b"+a.length,
+  "join",
+  'true',
+  '"104,101,108,108,111"' );
+
+a[a.length] = new TestObject(
+  "b"+a.length+" = wkTestStringToJavaByteArray(\"JavaScript\"); b"+a.length+".reverse().join() +''",
+  "b"+a.length,
+  "reverse",
+  'true',
+  'getCharValues("tpircSavaJ")' );
+
+a[a.length] = new TestObject(
+  "b"+a.length+" = wkTestStringToJavaByteArray(\"JavaScript\"); b"+a.length+".sort().join() +''",
+  "b"+a.length,
+  "sort",
+  'true',
+  '"105,112,114,116,118,74,83,97,97,99"' );
+
+a[a.length] = new TestObject(
+  "b"+a.length+" = wkTestStringToJavaByteArray(\"JavaScript\"); b"+a.length+".sort().join() +''",
+  "b"+a.length,
+  "sort",
+  'true',
+  '"105,112,114,116,118,74,83,97,97,99"' );
+
+// given a string, return a string consisting of the char value of each
+// character in the string, separated by commas
+
+function getCharValues(string) {
+  for ( var c = 0, cString = ""; c < string.length; c++ ) {
+    cString += string.charCodeAt(c) + ((c+1 < string.length) ? "," : "");
+  }
+  return cString;
+}
+
+// figure out what methods exist
+// if there is no java method with the same name as a js method, should
+// be able to invoke the js method without casting to a js string.  also
+// the method should equal the same method of String.prototype.
+// if there is a java method with the same name as a js method, invoking
+// the method should call the java method
+
+function TestObject( description, ob, method, override, expect ) {
+  this.description = description;
+  this.object = ob;
+  this.method = method;
+  this.override = override
+
+  // verify result of method
+  shouldBeWithErrorCheck(
+    description,
+    expect);
+
+  // verify that method is the method of Array.prototype
+
+  shouldBeWithErrorCheck(
+    ob +"." + method +" == Array.prototype." + method,
+    override);
+
+  // verify that it's not cast to JS Array type
+
+  shouldBeWithErrorCheck(
+    ob + ".getClass().getName() +''",
+    '"[B"');
+
+}
diff --git a/LayoutTests/java/lc3/ArrayMethods/byte-002-expected.txt b/LayoutTests/java/lc3/ArrayMethods/byte-002-expected.txt
new file mode 100644 (file)
index 0000000..5799a86
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 java array object inheritance JavaScript Array methods
+
+PASS b.valueOf() is b
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ArrayMethods/byte-002.html b/LayoutTests/java/lc3/ArrayMethods/byte-002.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ArrayMethods/byte-002.js b/LayoutTests/java/lc3/ArrayMethods/byte-002.js
new file mode 100644 (file)
index 0000000..a7fa463
--- /dev/null
@@ -0,0 +1,41 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'byte-002.js';
+
+/**
+ *  java array objects "inherit" JS string methods.  verify that byte arrays
+ *  can inherit JavaScript Array object methods
+ *
+ *
+ */
+var SECTION = "java array object inheritance JavaScript Array methods";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 " + SECTION;
+
+startTest();
+
+var b = wkTestStringToJavaByteArray("abcdefghijklmnopqrstuvwxyz");
+
+shouldBeWithErrorCheck(
+  "b.valueOf()",
+  'b');
diff --git a/LayoutTests/java/lc3/ArrayMethods/object-001.html-disabled b/LayoutTests/java/lc3/ArrayMethods/object-001.html-disabled
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ArrayMethods/object-001.js b/LayoutTests/java/lc3/ArrayMethods/object-001.js
new file mode 100644 (file)
index 0000000..ddf30a0
--- /dev/null
@@ -0,0 +1,67 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.<!DOCTYPE html>
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'object-001.js';
+
+/**
+ *  java array objects "inherit" JS string methods.  verify that byte arrays
+ *  can inherit JavaScript Array object methods join, reverse, sort and valueOf
+ *
+ */
+var SECTION = "java array object inheritance JavaScript Array methods";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 " + SECTION;
+
+startTest();
+
+dt = applet.createQAObject("com.netscape.javascript.qa.liveconnect.DataTypeClass");
+
+obArray = dt.PUB_ARRAY_OBJECT;
+
+// check string value
+
+shouldBeWithErrorCheck(
+  "obArray.join()",
+  'join(obArray)');
+
+// check type of object returned by method
+
+shouldBeWithErrorCheck(
+  "obArray.reverse().join() + ''",
+  'reverse(obArray)');
+
+shouldBeWithErrorCheck(
+  "obArray.reverse().getClass().getName() +''",
+  '"[Ljava.lang.Object;"');
+
+function join( a ) {
+  for ( var i = 0, s = ""; i < a.length; i++ ) {
+    s += a[i].toString() + ( i + 1 < a.length ? "," : "" );
+  }
+  return s;
+}
+function reverse( a ) {
+  for ( var i = a.length -1, s = ""; i >= 0; i-- ) {
+    s += a[i].toString() + ( i> 0 ? "," : "" );
+  }
+  return s;
+}
diff --git a/LayoutTests/java/lc3/CallStatic/boolean-001-expected.txt b/LayoutTests/java/lc3/CallStatic/boolean-001-expected.txt
new file mode 100644 (file)
index 0000000..530a1fa
--- /dev/null
@@ -0,0 +1,12 @@
+LiveConnect 3.0 Call static methods from an instance
+
+PASS dt.staticSetBoolean( true ); dt.PUB_STATIC_BOOLEAN is true
+PASS dt.staticSetBoolean( true ); dt.staticGetBoolean() is true
+PASS typeof dt.staticGetBoolean() is "boolean"
+PASS dt.staticSetBoolean( false ); dt.PUB_STATIC_BOOLEAN is false
+PASS dt.staticSetBoolean( false ); dt.staticGetBoolean() is false
+PASS typeof dt.staticGetBoolean() is "boolean"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/CallStatic/boolean-001.html b/LayoutTests/java/lc3/CallStatic/boolean-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/CallStatic/boolean-001.js b/LayoutTests/java/lc3/CallStatic/boolean-001.js
new file mode 100644 (file)
index 0000000..71f9eec
--- /dev/null
@@ -0,0 +1,84 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-001.js';
+
+/**
+ *  The Java language allows static methods to be invoked using either the
+ *  class name or a reference to an instance of the class, but previous
+ *  versions of liveocnnect only allowed the former.
+ *
+ *  author: christine@netscape.com
+ *
+ *  date:  12/9/1998
+ *
+ */
+var SECTION = "Call static methods from an instance";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 " +
+  SECTION;
+startTest();
+
+dt = applet.createQAObject("com.netscape.javascript.qa.liveconnect.DataTypeClass");
+
+var a = new Array;
+var i = 0;
+
+a[i++] = new TestObject(
+  "dt.staticSetBoolean( true )",
+  "dt.PUB_STATIC_BOOLEAN",
+  "dt.staticGetBoolean()",
+  "typeof dt.staticGetBoolean()",
+  'true',
+  '"boolean"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetBoolean( false )",
+  "dt.PUB_STATIC_BOOLEAN",
+  "dt.staticGetBoolean()",
+  "typeof dt.staticGetBoolean()",
+  'false',
+  '"boolean"' );
+
+for ( i = 0; i < a.length; i++ ) {
+  shouldBeWithErrorCheck(
+    a[i].description +"; "+ a[i].javaFieldName,
+    a[i].jsValue);
+
+  shouldBeWithErrorCheck(
+    a[i].description +"; " + a[i].javaMethodName,
+    a[i].jsValue);
+
+  shouldBeWithErrorCheck(
+    a[i].javaTypeName,
+    a[i].jsType);
+}
+
+function TestObject(description, javaField, javaMethod, javaType, jsValue, jsType)
+{
+  this.description = description;
+  this.javaFieldName = javaField;
+  this.javaMethodName = javaMethod;
+  this.javaTypeName = javaType,
+  this.jsValue = jsValue;
+  this.jsType = jsType;
+}
diff --git a/LayoutTests/java/lc3/CallStatic/number-001-expected.txt b/LayoutTests/java/lc3/CallStatic/number-001-expected.txt
new file mode 100644 (file)
index 0000000..7690736
--- /dev/null
@@ -0,0 +1,27 @@
+LiveConnect 3.0 Call static methods from an instance
+
+PASS dt.staticSetByte( 99 ); dt.PUB_STATIC_BYTE is 99
+PASS dt.staticSetByte( 99 ); dt.staticGetByte() is 99
+PASS typeof dt.staticGetByte() is "number"
+PASS dt.staticSetChar( 45678 ); dt.PUB_STATIC_CHAR is 45678
+PASS dt.staticSetChar( 45678 ); dt.staticGetChar() is 45678
+PASS typeof dt.staticGetChar() is "number"
+PASS dt.staticSetShort( 32109 ); dt.PUB_STATIC_SHORT is 32109
+PASS dt.staticSetShort( 32109 ); dt.staticGetShort() is 32109
+PASS typeof dt.staticGetShort() is "number"
+PASS dt.staticSetInteger( 2109876543 ); dt.PUB_STATIC_INT is 2109876543
+PASS dt.staticSetInteger( 2109876543 ); dt.staticGetInteger() is 2109876543
+PASS typeof dt.staticGetInteger() is "number"
+FAIL dt.staticSetLong( 9012345678901234567 ); dt.PUB_STATIC_LONG should be 9012345678901235000. Was 693107667.
+PASS dt.staticSetLong( 9012345678901234567 ); dt.staticGetLong() is 9012345678901234567
+PASS typeof dt.staticGetLong() is "number"
+FAIL java.lang.Double.MIN_VALUE: ReferenceError: Can't find variable: java
+FAIL java.lang.Double.MIN_VALUE: ReferenceError: Can't find variable: java
+PASS typeof dt.staticGetDouble() is "number"
+FAIL java.lang.Float.MIN_VALUE: ReferenceError: Can't find variable: java
+FAIL java.lang.Float.MIN_VALUE: ReferenceError: Can't find variable: java
+PASS typeof dt.staticGetFloat() is "number"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/CallStatic/number-001.html b/LayoutTests/java/lc3/CallStatic/number-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/CallStatic/number-001.js b/LayoutTests/java/lc3/CallStatic/number-001.js
new file mode 100644 (file)
index 0000000..2cdc2e5
--- /dev/null
@@ -0,0 +1,127 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'number-001.js';
+
+/**
+ *  The Java language allows static methods to be invoked using either the
+ *  class name or a reference to an instance of the class, but previous
+ *  versions of liveocnnect only allowed the former.
+ *
+ *  Verify that we can call static methods and get the value of static fields
+ *  from an instance reference.
+ *
+ *  author: christine@netscape.com
+ *
+ *  date:  12/9/1998
+ *
+ */
+var SECTION = "Call static methods from an instance";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 " +
+  SECTION;
+startTest();
+
+dt = applet.createQAObject("com.netscape.javascript.qa.liveconnect.DataTypeClass");
+
+var a = new Array;
+var i = 0;
+
+a[i++] = new TestObject(
+  "dt.staticSetByte( 99 )",
+  "dt.PUB_STATIC_BYTE",
+  "dt.staticGetByte()",
+  "typeof dt.staticGetByte()",
+  '99',
+  '"number"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetChar( 45678 )",
+  "dt.PUB_STATIC_CHAR",
+  "dt.staticGetChar()",
+  "typeof dt.staticGetChar()",
+  '45678',
+  '"number"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetShort( 32109 )",
+  "dt.PUB_STATIC_SHORT",
+  "dt.staticGetShort()",
+  "typeof dt.staticGetShort()",
+  '32109',
+  '"number"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetInteger( 2109876543 )",
+  "dt.PUB_STATIC_INT",
+  "dt.staticGetInteger()",
+  "typeof dt.staticGetInteger()",
+  '2109876543',
+  '"number"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetLong( 9012345678901234567 )",
+  "dt.PUB_STATIC_LONG",
+  "dt.staticGetLong()",
+  "typeof dt.staticGetLong()",
+  '9012345678901234567',
+  '"number"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetDouble( java.lang.Double.MIN_VALUE )",
+  "dt.PUB_STATIC_DOUBLE",
+  "dt.staticGetDouble()",
+  "typeof dt.staticGetDouble()",
+  "java.lang.Double.MIN_VALUE",
+  '"number"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetFloat( java.lang.Float.MIN_VALUE )",
+  "dt.PUB_STATIC_FLOAT",
+  "dt.staticGetFloat()",
+  "typeof dt.staticGetFloat()",
+  "java.lang.Float.MIN_VALUE",
+  '"number"' );
+
+for ( i = 0; i < a.length; i++ ) {
+  shouldBeWithErrorCheck(
+    a[i].description +"; "+ a[i].javaFieldName,
+    a[i].jsValue);
+
+  shouldBeWithErrorCheck(
+    a[i].description +"; " + a[i].javaMethodName,
+    a[i].jsValue);
+
+  shouldBeWithErrorCheck(
+    a[i].javaTypeName,
+    a[i].jsType);
+}
+
+function TestObject(description, javaField, javaMethod, javaType, jsValue, jsType)
+{
+  this.description = description;
+  this.javaFieldName = javaField;
+  this.javaMethodName = javaMethod;
+  this.javaTypeName = javaType,
+  this.jsValue = jsValue;
+  this.jsType = jsType;
+}
diff --git a/LayoutTests/java/lc3/CallStatic/object-001-expected.txt b/LayoutTests/java/lc3/CallStatic/object-001-expected.txt
new file mode 100644 (file)
index 0000000..d2f28f6
--- /dev/null
@@ -0,0 +1,27 @@
+LiveConnect 3.0 Call static methods from an instance
+
+FAIL dt.staticSetDoubleObject( 99 ); dt.PUB_STATIC_DOUBLE_OBJECT.doubleValue() should be 99. Threw exception TypeError: Result of expression 'dt.PUB_STATIC_DOUBLE_OBJECT' [null] is not an object.
+FAIL dt.staticSetDoubleObject( 99 ); dt.staticGetDoubleObject().doubleValue() should be 99. Threw exception TypeError: Result of expression 'dt.staticGetDoubleObject()' [undefined] is not an object.
+FAIL dt.staticGetDoubleObject().getClass().getName() +'' should be java.lang.Double. Threw exception TypeError: Result of expression 'dt.staticGetDoubleObject()' [undefined] is not an object.
+FAIL dt.staticSetShortObject( new java.lang.Short(32109) ); dt.PUB_STATIC_SHORT_OBJECT.doubleValue() should be 32109. Threw exception ReferenceError: Can't find variable: java
+FAIL dt.staticSetShortObject( new java.lang.Short(32109) ); dt.staticGetShortObject().doubleValue() should be 32109. Threw exception ReferenceError: Can't find variable: java
+PASS dt.staticGetShortObject().getClass().getName() +'' is "java.lang.Short"
+FAIL dt.staticSetIntegerObject( new java.lang.Integer(2109876543) ); dt.PUB_STATIC_INTEGER_OBJECT.doubleValue() should be 2109876543. Threw exception ReferenceError: Can't find variable: java
+FAIL dt.staticSetIntegerObject( new java.lang.Integer(2109876543) ); dt.staticGetIntegerObject().doubleValue() should be 2109876543. Threw exception ReferenceError: Can't find variable: java
+PASS dt.staticGetIntegerObject().getClass().getName() +'' is "java.lang.Integer"
+FAIL dt.staticSetLongObject( new java.lang.Long(9012345678901234567) ); dt.PUB_STATIC_LONG_OBJECT.doubleValue() should be 9012345678901235000. Threw exception ReferenceError: Can't find variable: java
+FAIL dt.staticSetLongObject( new java.lang.Long(9012345678901234567) ); dt.staticGetLongObject().doubleValue() should be 9012345678901235000. Threw exception ReferenceError: Can't find variable: java
+PASS dt.staticGetLongObject().getClass().getName() +'' is "java.lang.Long"
+FAIL java.lang.Double.MIN_VALUE: ReferenceError: Can't find variable: java
+FAIL java.lang.Double.MIN_VALUE: ReferenceError: Can't find variable: java
+FAIL java.lang.Double: ReferenceError: Can't find variable: java
+FAIL java.lang.Float.MIN_VALUE: ReferenceError: Can't find variable: java
+FAIL java.lang.Float.MIN_VALUE: ReferenceError: Can't find variable: java
+PASS dt.staticGetFloatObject().getClass().getName() +'' is "java.lang.Float"
+FAIL dt.staticSetCharacter( new java.lang.Character(45678) ); dt.PUB_STATIC_CHAR_OBJECT.charValue() should be 45678. Threw exception ReferenceError: Can't find variable: java
+FAIL dt.staticSetCharacter( new java.lang.Character(45678) ); dt.staticGetCharacter().charValue() should be 45678. Threw exception ReferenceError: Can't find variable: java
+PASS dt.staticGetCharacter().getClass().getName()+'' is "java.lang.Character"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/CallStatic/object-001.html b/LayoutTests/java/lc3/CallStatic/object-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/CallStatic/object-001.js b/LayoutTests/java/lc3/CallStatic/object-001.js
new file mode 100644 (file)
index 0000000..45ef12a
--- /dev/null
@@ -0,0 +1,128 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'object-001.js';
+
+/**
+ *  The Java language allows static methods to be invoked using either the
+ *  class name or a reference to an instance of the class, but previous
+ *  versions of liveocnnect only allowed the former.
+ *
+ *  Verify that we can call static methods and get the value of static fields
+ *  from an instance reference.
+ *
+ *  author: christine@netscape.com
+ *
+ *  date:  12/9/1998
+ *
+ */
+var SECTION = "Call static methods from an instance";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 " +
+  SECTION;
+startTest();
+
+dt = applet.createQAObject("com.netscape.javascript.qa.liveconnect.DataTypeClass");
+
+var a = new Array;
+var i = 0;
+
+a[i++] = new TestObject(
+  "dt.staticSetDoubleObject( 99 )",
+  "dt.PUB_STATIC_DOUBLE_OBJECT.doubleValue()",
+  "dt.staticGetDoubleObject().doubleValue()",
+  "dt.staticGetDoubleObject().getClass().getName() +''",
+  '99',
+  '"java.lang.Double"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetShortObject( new java.lang.Short(32109) )",
+  "dt.PUB_STATIC_SHORT_OBJECT.doubleValue()",
+  "dt.staticGetShortObject().doubleValue()",
+  "dt.staticGetShortObject().getClass().getName() +''",
+  '32109',
+  '"java.lang.Short"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetIntegerObject( new java.lang.Integer(2109876543) )",
+  "dt.PUB_STATIC_INTEGER_OBJECT.doubleValue()",
+  "dt.staticGetIntegerObject().doubleValue()",
+  "dt.staticGetIntegerObject().getClass().getName() +''",
+  '2109876543',
+  '"java.lang.Integer"' );
+
+
+a[i++] = new TestObject(
+  "dt.staticSetLongObject( new java.lang.Long(9012345678901234567) )",
+  "dt.PUB_STATIC_LONG_OBJECT.doubleValue()",
+  "dt.staticGetLongObject().doubleValue()",
+  "dt.staticGetLongObject().getClass().getName() +''",
+  '9012345678901234567',
+  '"java.lang.Long"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetDoubleObject(new java.lang.Double( java.lang.Double.MIN_VALUE) )",
+  "dt.PUB_STATIC_DOUBLE_OBJECT.doubleValue()",
+  "dt.staticGetDoubleObject().doubleValue()",
+  "dt.staticGetDoubleObject().getClass().getName()+''",
+  "java.lang.Double.MIN_VALUE",
+  "java.lang.Double" );
+
+a[i++] = new TestObject(
+  "dt.staticSetFloatObject( new java.lang.Float(java.lang.Float.MIN_VALUE) )",
+  "dt.PUB_STATIC_FLOAT_OBJECT.doubleValue()",
+  "dt.staticGetFloatObject().doubleValue()",
+  "dt.staticGetFloatObject().getClass().getName() +''",
+  "java.lang.Float.MIN_VALUE",
+  '"java.lang.Float"' );
+
+a[i++] = new TestObject(
+  "dt.staticSetCharacter( new java.lang.Character(45678) )",
+  "dt.PUB_STATIC_CHAR_OBJECT.charValue()",
+  "dt.staticGetCharacter().charValue()",
+  "dt.staticGetCharacter().getClass().getName()+''",
+  '45678',
+  '"java.lang.Character"' );
+
+for ( i = 0; i < a.length; i++ ) {
+  shouldBeWithErrorCheck(
+    a[i].description +"; "+ a[i].javaFieldName,
+    a[i].jsValue);
+
+  shouldBeWithErrorCheck(
+    a[i].description +"; " + a[i].javaMethodName,
+    a[i].jsValue);
+
+  shouldBeWithErrorCheck(
+    a[i].javaTypeName,
+    a[i].jsType);
+}
+
+function TestObject(description, javaField, javaMethod, javaType, jsValue, jsType)
+{
+  this.description = description;
+  this.javaFieldName = javaField;
+  this.javaMethodName = javaMethod;
+  this.javaTypeName = javaType,
+  this.jsValue = jsValue;
+  this.jsType = jsType;
+}
diff --git a/LayoutTests/java/lc3/Constructors/construct-001-expected.txt b/LayoutTests/java/lc3/Constructors/construct-001-expected.txt
new file mode 100644 (file)
index 0000000..11b67bd
--- /dev/null
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: line 37: ReferenceError: Can't find variable: Packages
+LiveConnect 3.0 JavaScript to Java Data Conversion
+
+FAIL successfullyParsed should be true. Threw exception ReferenceError: Can't find variable: successfullyParsed
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/Constructors/construct-001.html b/LayoutTests/java/lc3/Constructors/construct-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/Constructors/construct-001.js b/LayoutTests/java/lc3/Constructors/construct-001.js
new file mode 100644 (file)
index 0000000..482cefd
--- /dev/null
@@ -0,0 +1,154 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'construct-001.js';
+
+/**
+ *  Verify that specific constructors can be invoked.
+ *
+ *
+ */
+
+var SECTION = "Explicit Constructor Invokation";
+var VERSION = "JS1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Conversion";
+
+startTest();
+
+var DT = Packages.com.netscape.javascript.qa.liveconnect.DataTypeClass;
+
+shouldBeWithErrorCheck(
+  "new DT().PUB_INT_CONSTRUCTOR_ARG",
+  "new DT().CONSTRUCTOR_ARG_NONE");
+
+shouldBeWithErrorCheck(
+  "new DT(5).PUB_INT_CONSTRUCTOR_ARG",
+  "new DT(5).CONSTRUCTOR_ARG_DOUBLE");
+
+shouldBeWithErrorCheck(
+  "new DT(true).PUB_INT_CONSTRUCTOR_ARG",
+  "new DT(true).CONSTRUCTOR_ARG_BOOLEAN");
+
+// force type conversion
+
+// convert boolean
+
+shouldBeWithErrorCheck(
+ 'new DT["(boolean)"](true).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT("5").CONSTRUCTOR_ARG_BOOLEAN');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.Boolean)"](true).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_BOOLEAN_OBJECT');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.Object)"](true).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT("5").CONSTRUCTOR_ARG_OBJECT');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.String)"](true).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_STRING');
+
+
+// convert number
+
+shouldBeWithErrorCheck(
+  'new DT["(double)"]("5").PUB_INT_CONSTRUCTOR_ARG',
+  'new DT(5).CONSTRUCTOR_ARG_DOUBLE');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.Double)"](5).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT(5).CONSTRUCTOR_ARG_DOUBLE_OBJECT');
+
+shouldBeWithErrorCheck(
+  'new DT["(char)"](5).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_CHAR');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.Object)"](5).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_OBJECT');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.String)"](5).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_STRING');
+
+// convert string
+
+shouldBeWithErrorCheck(
+  'new DT("5").PUB_INT_CONSTRUCTOR_ARG',
+  'new DT("5").CONSTRUCTOR_ARG_STRING');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.String)"]("5").PUB_INT_CONSTRUCTOR_ARG',
+  'new DT("5").CONSTRUCTOR_ARG_STRING');
+
+shouldBeWithErrorCheck(
+  'new DT["(char)"]("J").PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_CHAR');
+
+shouldBeWithErrorCheck(
+  'new DT["(double)"]("5").PUB_INT_CONSTRUCTOR_ARG',
+  'new DT("5").CONSTRUCTOR_ARG_DOUBLE');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.Object)"]("hello").PUB_INT_CONSTRUCTOR_ARG',
+  'new DT("hello").CONSTRUCTOR_ARG_OBJECT');
+
+// convert java object
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.Object)"](new java.lang.String("hello")).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_OBJECT');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.Object)"](new java.lang.String("hello")).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_OBJECT');
+
+shouldBeWithErrorCheck(
+  'new DT["(double)"](new java.lang.Double(5)).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_DOUBLE');
+
+shouldBeWithErrorCheck(
+  'new DT["(char)"](new java.lang.Double(5)).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_CHAR');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.String)"](new java.lang.Double(5)).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT().CONSTRUCTOR_ARG_STRING');
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.Double)"](new java.lang.Double(5)).PUB_INT_CONSTRUCTOR_ARG',
+  new DT().CONSTRUCTOR_ARG_DOUBLE_OBJECT);
+
+shouldBeWithErrorCheck(
+  'new DT(new java.lang.Double(5)).PUB_INT_CONSTRUCTOR_ARG',
+  new DT().CONSTRUCTOR_ARG_DOUBLE_OBJECT);
+
+// java array
+
+shouldBeWithErrorCheck(
+  'new DT["(java.lang.String)"](new java.lang.String("hello").getBytes()).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT("hello").CONSTRUCTOR_ARG_STRING');
+
+shouldBeWithErrorCheck(
+  'new DT["(byte[])"](new java.lang.String("hello").getBytes()).PUB_INT_CONSTRUCTOR_ARG',
+  'new DT("hello").CONSTRUCTOR_ARG_BYTE_ARRAY');
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-001-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-001-expected.txt
new file mode 100644 (file)
index 0000000..f4f492b
--- /dev/null
@@ -0,0 +1,8 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS.ambiguous( true ) should be BOOLEAN. Was BYTE.
+FAIL TEST_CLASS.ambiguous( false ) should be BOOLEAN. Was BYTE.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-001.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-001.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-001.js
new file mode 100644 (file)
index 0000000..1ea2e4a
--- /dev/null
@@ -0,0 +1,46 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-001.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *  Passing a JavaScript boolean to a Java method should prefer to call
+ *  a Java method of the same name that expects a Java boolean.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_001");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( true )",
+  'TEST_CLASS.expect()');
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( false )",
+  'TEST_CLASS.expect()');
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-002-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-002-expected.txt
new file mode 100644 (file)
index 0000000..537fdb8
--- /dev/null
@@ -0,0 +1,8 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS.ambiguous( true ) should be 1. Was 128.
+FAIL TEST_CLASS.ambiguous( false ) should be 1. Was 128.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-002.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-002.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-002.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-002.js
new file mode 100644 (file)
index 0000000..e85885f
--- /dev/null
@@ -0,0 +1,44 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-002.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_002");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( true )",
+  "TEST_CLASS.expect()");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( false )",
+  "TEST_CLASS.expect()");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-003-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-003-expected.txt
new file mode 100644 (file)
index 0000000..6709feb
--- /dev/null
@@ -0,0 +1,8 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS.ambiguous( true ) should be 2. Was 128.
+FAIL TEST_CLASS.ambiguous( false ) should be 2. Was 128.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-003.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-003.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-003.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-003.js
new file mode 100644 (file)
index 0000000..361085f
--- /dev/null
@@ -0,0 +1,44 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-003.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_003");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( true )",
+  "TEST_CLASS.expect()");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( false )",
+  "TEST_CLASS.expect()");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-004-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-004-expected.txt
new file mode 100644 (file)
index 0000000..d5415b0
--- /dev/null
@@ -0,0 +1,8 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS.ambiguous( true ) should be 4. Was 128.
+FAIL TEST_CLASS.ambiguous( false ) should be 4. Was 128.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-004.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-004.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-004.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-004.js
new file mode 100644 (file)
index 0000000..0da42cb
--- /dev/null
@@ -0,0 +1,44 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-004.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_004");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( true )",
+  "TEST_CLASS.expect()");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( false )",
+  "TEST_CLASS.expect()");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-005-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-005-n-expected.txt
new file mode 100644 (file)
index 0000000..4557c54
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS.ambiguous( true ) should throw an exception. Was 128.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-005-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-005-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-005-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-005-n.js
new file mode 100644 (file)
index 0000000..e480fe6
--- /dev/null
@@ -0,0 +1,43 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-005-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_005");
+
+DESCRIPTION = "TEST_CLASS.ambiguous( true )";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( true )",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-006-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-006-n-expected.txt
new file mode 100644 (file)
index 0000000..3d6ccf2
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS.ambiguous( false ) should throw an exception. Was 128.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-006-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-006-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-006-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-006-n.js
new file mode 100644 (file)
index 0000000..2473b20
--- /dev/null
@@ -0,0 +1,43 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-006-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_005");
+
+DESCRIPTION = "TEST_CLASS.ambiguous( false )";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( false )",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-007-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-007-n-expected.txt
new file mode 100644 (file)
index 0000000..a15c75b
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+PASS TEST_CLASS["ambiguous(long)"](true) threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(long)"]' [undefined] is not a function..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-007-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-007-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-007-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-007-n.js
new file mode 100644 (file)
index 0000000..85f5f86
--- /dev/null
@@ -0,0 +1,45 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-007-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ * It is an error to pass a JavaScript boolean to a method that expects
+ * a primitive Java numeric type.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_004");
+
+DESCRIPTION = "TEST_CLASS[\"ambiguous(long)\"](true)";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(long)\"](true)",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-008-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-008-n-expected.txt
new file mode 100644 (file)
index 0000000..53e6e7c
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+PASS TEST_CLASS["ambiguous(short)"](true) threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(short)"]' [undefined] is not a function..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-008-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-008-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-008-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-008-n.js
new file mode 100644 (file)
index 0000000..18898b2
--- /dev/null
@@ -0,0 +1,45 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-008-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ * It is an error to pass a JavaScript boolean to a method that expects
+ * a primitive Java numeric type.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_004");
+
+DESCRIPTION = "TEST_CLASS[\"ambiguous(short)\"](true)";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(short)\"](true)",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-009-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-009-n-expected.txt
new file mode 100644 (file)
index 0000000..fe58f09
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+PASS TEST_CLASS["ambiguous(char)"](true) threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(char)"]' [undefined] is not a function..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-009-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-009-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-009-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-009-n.js
new file mode 100644 (file)
index 0000000..4feda90
--- /dev/null
@@ -0,0 +1,45 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-009-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ * It is an error to pass a JavaScript boolean to a method that expects
+ * a primitive Java numeric type.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_004");
+
+DESCRIPTION = "TEST_CLASS[\"ambiguous(char)\"](true)";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(char)\"](true)",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-010-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-010-n-expected.txt
new file mode 100644 (file)
index 0000000..0b69e85
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+PASS TEST_CLASS["ambiguous(int)"](true) threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(int)"]' [undefined] is not a function..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-010-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-010-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-010-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-010-n.js
new file mode 100644 (file)
index 0000000..e86de74
--- /dev/null
@@ -0,0 +1,45 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-010-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ * It is an error to pass a JavaScript boolean to a method that expects
+ * a primitive Java numeric type.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_004");
+
+DESCRIPTION = "TEST_CLASS[\"ambiguous(int)\"](true)";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(int)\"](true)",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-011-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-011-n-expected.txt
new file mode 100644 (file)
index 0000000..049f018
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+PASS TEST_CLASS["ambiguous(byte)"](true) threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(byte)"]' [undefined] is not a function..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-011-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-011-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-011-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-011-n.js
new file mode 100644 (file)
index 0000000..35b7ac3
--- /dev/null
@@ -0,0 +1,45 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-011-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ * It is an error to pass a JavaScript boolean to a method that expects
+ * a primitive Java numeric type.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_004");
+
+DESCRIPTION = "TEST_CLASS[\"ambiguous(byte)\"](true)";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(byte)\"](true)",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-012-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-012-n-expected.txt
new file mode 100644 (file)
index 0000000..2cc149d
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+PASS TEST_CLASS["ambiguous(double)"](true) threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(double)"]' [undefined] is not a function..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-012-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-012-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-012-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-012-n.js
new file mode 100644 (file)
index 0000000..b55e441
--- /dev/null
@@ -0,0 +1,45 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-012-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ * It is an error to pass a JavaScript boolean to a method that expects
+ * a primitive Java numeric type.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_004");
+
+DESCRIPTION = "TEST_CLASS[\"ambiguous(double)\"](true)";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(double)\"](true)",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-013-n-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-013-n-expected.txt
new file mode 100644 (file)
index 0000000..2c5866c
--- /dev/null
@@ -0,0 +1,7 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+PASS TEST_CLASS["ambiguous(float)"](true) threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(float)"]' [undefined] is not a function..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-013-n.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-013-n.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-013-n.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-013-n.js
new file mode 100644 (file)
index 0000000..96bced1
--- /dev/null
@@ -0,0 +1,45 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-013-n.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ * It is an error to pass a JavaScript boolean to a method that expects
+ * a primitive Java numeric type.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_004");
+
+DESCRIPTION = "TEST_CLASS[\"ambiguous(float)\"](true)";
+EXPECTED = "error";
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(float)\"](true)",
+  "'error'");
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-014-expected.txt b/LayoutTests/java/lc3/ConvertBoolean/boolean-014-expected.txt
new file mode 100644 (file)
index 0000000..637cae3
--- /dev/null
@@ -0,0 +1,12 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS["ambiguous(java.lang.Boolean)"](true) should be BOOLEAN_OBJECT. Threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(java.lang.Boolean)"]' [undefined] is not a function.
+FAIL TEST_CLASS["ambiguous(java.lang.Boolean)"](false) should be BOOLEAN_OBJECT. Threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(java.lang.Boolean)"]' [undefined] is not a function.
+FAIL TEST_CLASS["ambiguous(java.lang.Object)"](true) should be OBJECT. Threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(java.lang.Object)"]' [undefined] is not a function.
+FAIL TEST_CLASS["ambiguous(java.lang.Object)"](false) should be OBJECT. Threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(java.lang.Object)"]' [undefined] is not a function.
+FAIL TEST_CLASS["ambiguous(java.lang.String)"](true) should be STRING. Threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(java.lang.String)"]' [undefined] is not a function.
+FAIL TEST_CLASS["ambiguous(java.lang.String)"](false) should be STRING. Threw exception TypeError: Result of expression 'TEST_CLASS["ambiguous(java.lang.String)"]' [undefined] is not a function.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-014.html b/LayoutTests/java/lc3/ConvertBoolean/boolean-014.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertBoolean/boolean-014.js b/LayoutTests/java/lc3/ConvertBoolean/boolean-014.js
new file mode 100644 (file)
index 0000000..fd88b10
--- /dev/null
@@ -0,0 +1,68 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'boolean-014.js';
+
+/**
+ * Preferred Argument Conversion.
+ *
+ * Use the syntax for explicit method invokation to override the default
+ * preferred argument conversion.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.bool.Boolean_001");
+
+// invoke method that accepts java.lang.Boolean
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(java.lang.Boolean)\"](true)",
+  "TEST_CLASS.BOOLEAN_OBJECT");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(java.lang.Boolean)\"](false)",
+  "TEST_CLASS.BOOLEAN_OBJECT");
+
+// invoke method that expects java.lang.Object
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(java.lang.Object)\"](true)",
+  "TEST_CLASS.OBJECT");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(java.lang.Object)\"](false)",
+  "TEST_CLASS.OBJECT");
+
+// invoke method that expects a String
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(java.lang.String)\"](true)",
+  "TEST_CLASS.STRING");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS[\"ambiguous(java.lang.String)\"](false)",
+  "TEST_CLASS.STRING");
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001-expected.txt b/LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001-expected.txt
new file mode 100644 (file)
index 0000000..b0dbd7c
--- /dev/null
@@ -0,0 +1,15 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS.ambiguous( new String() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Boolean() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Number() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Date() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Function() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( this ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new RegExp() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( Math ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Object() ) +'' should be DOUBLE. Was BYTE.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001.html b/LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001.js b/LayoutTests/java/lc3/ConvertJSObject/ToBoolean-001.js
new file mode 100644 (file)
index 0000000..0463ea4
--- /dev/null
@@ -0,0 +1,74 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'ToBoolean-001.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *  Passing a JavaScript boolean to a Java method should prefer to call
+ *  a Java method of the same name that expects a Java boolean.
+ *
+ */
+var SECTION = "Preferred argument conversion:  boolean";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.jsobject.JSObject_004");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new String() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Boolean() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Number() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Date() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Function() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( this ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new RegExp() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( Math ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Object() ) +''",
+  "'DOUBLE'");
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToByte-001-expected.txt b/LayoutTests/java/lc3/ConvertJSObject/ToByte-001-expected.txt
new file mode 100644 (file)
index 0000000..25ff0f2
--- /dev/null
@@ -0,0 +1,12 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  JavaScript Object to short
+
+PASS TEST_CLASS.ambiguous( new String() ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( new Boolean() ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( new Number() ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( new Date(99) ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( new MyObject(127) ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( MyFunction ) +'' is 'BYTE'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToByte-001.html b/LayoutTests/java/lc3/ConvertJSObject/ToByte-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToByte-001.js b/LayoutTests/java/lc3/ConvertJSObject/ToByte-001.js
new file mode 100644 (file)
index 0000000..1588ae2
--- /dev/null
@@ -0,0 +1,75 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'ToByte-001.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *  Passing a JavaScript boolean to a Java method should prefer to call
+ *  a Java method of the same name that expects a Java boolean.
+ *
+ */
+var SECTION = "Preferred argument conversion:  JavaScript Object to short";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.jsobject.JSObject_010");
+
+function MyObject( value ) {
+  this.value = value;
+  this.valueOf = new Function( "return this.value" );
+}
+
+function MyFunction() {
+  return;
+}
+MyFunction.valueOf = new Function( "return -128" );
+
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new String() ) +''",
+  "'BYTE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Boolean() ) +''",
+  "'BYTE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Number() ) +''",
+  "'BYTE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Date(99) ) +''",
+  "'BYTE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new MyObject(127) ) +''",
+  "'BYTE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( MyFunction ) +''",
+  "'BYTE'");
+
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToByte-002-expected.txt b/LayoutTests/java/lc3/ConvertJSObject/ToByte-002-expected.txt
new file mode 100644 (file)
index 0000000..a51f016
--- /dev/null
@@ -0,0 +1,11 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  JavaScript Object to int
+
+PASS TEST_CLASS.ambiguous( MyFunction ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( MyOtherFunction ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( new MyObject(123) ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( new MyOtherObject("123") ) +'' is 'BYTE'
+PASS TEST_CLASS.ambiguous( new AnotherObject("123") ) +'' is 'BYTE'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToByte-002.html b/LayoutTests/java/lc3/ConvertJSObject/ToByte-002.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToByte-002.js b/LayoutTests/java/lc3/ConvertJSObject/ToByte-002.js
new file mode 100644 (file)
index 0000000..f0b2e5a
--- /dev/null
@@ -0,0 +1,97 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'ToByte-002.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *  Passing a JavaScript boolean to a Java method should prefer to call
+ *  a Java method of the same name that expects a Java boolean.
+ *
+ */
+var SECTION = "Preferred argument conversion:  JavaScript Object to int";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.jsobject.JSObject_010");
+
+function MyFunction() {
+  return "hello";
+}
+MyFunction.valueOf = new Function( "return 99" );
+
+function MyOtherFunction() {
+  return "goodbye";
+}
+MyOtherFunction.valueOf = null;
+MyOtherFunction.toString = new Function( "return 99" );
+
+function MyObject(value) {
+  this.value = value;
+  this.valueOf = new Function("return this.value");
+}
+
+function MyOtherObject(stringValue) {
+  this.stringValue = String( stringValue );
+  this.toString = new Function( "return this.stringValue" );
+  this.valueOf = null;
+}
+
+function AnotherObject( value ) {
+  this.value = value;
+  this.valueOf = new Function( "return this.value" );
+  this.toString = new Function( "return 666" );
+}
+
+// should pass MyFunction.valueOf() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( MyFunction ) +''",
+  "'BYTE'");
+
+// should pass MyOtherFunction.toString() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( MyOtherFunction ) +''",
+  "'BYTE'");
+
+// should pass MyObject.valueOf() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new MyObject(123) ) +''",
+  "'BYTE'");
+
+// should pass MyOtherObject.toString() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new MyOtherObject(\"123\") ) +''",
+  "'BYTE'");
+
+// should pass AnotherObject.valueOf() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new AnotherObject(\"123\") ) +''",
+  "'BYTE'");
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToChar-001-expected.txt b/LayoutTests/java/lc3/ConvertJSObject/ToChar-001-expected.txt
new file mode 100644 (file)
index 0000000..38fe4de
--- /dev/null
@@ -0,0 +1,10 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  JavaScript Object to short
+
+FAIL TEST_CLASS.ambiguous( new String() ) +'' should be CHAR. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Boolean() ) +'' should be CHAR. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Number() ) +'' should be CHAR. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Date(999) ) +'' should be CHAR. Was BYTE.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToChar-001.html b/LayoutTests/java/lc3/ConvertJSObject/ToChar-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToChar-001.js b/LayoutTests/java/lc3/ConvertJSObject/ToChar-001.js
new file mode 100644 (file)
index 0000000..53ed32c
--- /dev/null
@@ -0,0 +1,56 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'ToChar-001.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *  Passing a JavaScript boolean to a Java method should prefer to call
+ *  a Java method of the same name that expects a Java boolean.
+ *
+ */
+var SECTION = "Preferred argument conversion:  JavaScript Object to short";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.jsobject.JSObject_009");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new String() ) +''",
+  "'CHAR'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Boolean() ) +''",
+  "'CHAR'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Number() ) +''",
+  "'CHAR'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Date(999) ) +''",
+  "'CHAR'");
+
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToChar-002-expected.txt b/LayoutTests/java/lc3/ConvertJSObject/ToChar-002-expected.txt
new file mode 100644 (file)
index 0000000..c38fe2f
--- /dev/null
@@ -0,0 +1,11 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  JavaScript Object to int
+
+FAIL TEST_CLASS.ambiguous( MyFunction ) +'' should be CHAR. Was BYTE.
+FAIL TEST_CLASS.ambiguous( MyOtherFunction ) +'' should be CHAR. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new MyObject(12345) ) +'' should be CHAR. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new MyOtherObject("12345") ) +'' should be CHAR. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new AnotherObject("12345") ) +'' should be CHAR. Was BYTE.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToChar-002.html b/LayoutTests/java/lc3/ConvertJSObject/ToChar-002.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToChar-002.js b/LayoutTests/java/lc3/ConvertJSObject/ToChar-002.js
new file mode 100644 (file)
index 0000000..da6c8ab
--- /dev/null
@@ -0,0 +1,97 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'ToChar-002.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *  Passing a JavaScript boolean to a Java method should prefer to call
+ *  a Java method of the same name that expects a Java boolean.
+ *
+ */
+var SECTION = "Preferred argument conversion:  JavaScript Object to int";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.jsobject.JSObject_009");
+
+function MyFunction() {
+  return "hello";
+}
+MyFunction.valueOf = new Function( "return 999" );
+
+function MyOtherFunction() {
+  return "goodbye";
+}
+MyOtherFunction.valueOf = null;
+MyOtherFunction.toString = new Function( "return 999" );
+
+function MyObject(value) {
+  this.value = value;
+  this.valueOf = new Function("return this.value");
+}
+
+function MyOtherObject(stringValue) {
+  this.stringValue = String( stringValue );
+  this.toString = new Function( "return this.stringValue" );
+  this.valueOf = null;
+}
+
+function AnotherObject( value ) {
+  this.value = value;
+  this.valueOf = new Function( "return this.value" );
+  this.toString = new Function( "return 666" );
+}
+
+// should pass MyFunction.valueOf() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( MyFunction ) +''",
+  "'CHAR'");
+
+// should pass MyOtherFunction.toString() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( MyOtherFunction ) +''",
+  "'CHAR'");
+
+// should pass MyObject.valueOf() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new MyObject(12345) ) +''",
+  "'CHAR'");
+
+// should pass MyOtherObject.toString() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new MyOtherObject(\"12345\") ) +''",
+  "'CHAR'");
+
+// should pass AnotherObject.valueOf() to ambiguous
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new AnotherObject(\"12345\") ) +''",
+  "'CHAR'");
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToDouble-001-expected.txt b/LayoutTests/java/lc3/ConvertJSObject/ToDouble-001-expected.txt
new file mode 100644 (file)
index 0000000..75b7bcc
--- /dev/null
@@ -0,0 +1,15 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion: JavaScript object to double
+
+FAIL TEST_CLASS.ambiguous( new String() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Boolean() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Number() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Date() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Function() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( this ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new RegExp() ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( Math ) +'' should be DOUBLE. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Object() ) +'' should be DOUBLE. Was BYTE.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToDouble-001.html b/LayoutTests/java/lc3/ConvertJSObject/ToDouble-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"
+  width=500
+  height=200
+  <param name="codebase" value="../../../java">
+  <param name="code" value="lc3.class">
+  <param name="archive" value="jstests.jar">
+  <comment>
+    <embed
+      code="lc3.class"
+      codebase="../../../java"
+      archive="jstests.jar"
+      type="application/x-java-applet"
+      width=500
+      height=200>
+    <noembed>
+      No Java Support.
+    </noembed>
+  </comment>
+</object>
+
+
+<script>
+function startTest()
+{
+    window.applet = document.getElementsByTagName("embed")[0];
+    if (!applet.createQAObject)
+        window.applet = document.getElementsByTagName("object")[0];
+
+    debug(TITLE + "\n");
+}
+
+function shouldBeWithErrorCheck(_a, _b)
+{
+    // Don't want full stack traces from Java exceptions.
+    if (window.layoutTestController) {
+        try {
+            eval(_a);
+        } catch (ex) {
+            if (/Caused by: /.test(ex)) {
+                testFailed(_a + ": Exception raised");
+                return;
+            }
+        }
+    }
+
+    var b_eval;
+    try {
+        b_eval = eval(_b);
+    } catch (ex) {
+        testFailed(_b + ": " + ex);
+        return;
+    }
+
+    if (b_eval == "error")
+        shouldThrow(_a);
+    else
+        shouldBe(_a, _b);
+}
+
+function wkTestStringToJavaByteArray(string)
+{
+    return applet.stringToByteArray(string);
+}
+
+function appendScript(text)
+{
+    var el = document.createElement("script")
+    el.appendChild = document.createTextNode(text);
+    document.body.appendChild(el);
+}
+
+function onload()
+{
+    try {
+        var req = new XMLHttpRequest();
+        req.open("GET", window.location.pathname.replace(/html$/, "js"), false);
+        if (req.overrideMimeType)
+            req.overrideMimeType("text/plain");
+        req.send();
+
+        if (!req.responseText.length)
+            throw "could not load test script";
+
+        var scriptElement = document.createElement("script")
+        scriptElement.appendChild(document.createTextNode(
+            req.responseText + "\n" + 
+            "successfullyParsed = true;\n"));
+        document.body.appendChild(scriptElement);
+    } catch (ex) {
+        testFailed("Could not run test: " + ex);
+    }
+
+    scriptElement = document.createElement("script")
+    scriptElement.src = '../../../fast/js/resources/js-test-post.js'
+    document.body.appendChild(scriptElement);
+
+    if (window.layoutTestController) {
+        scriptElement = document.createElement("script")
+        scriptElement.src = 'data:text/plain,layoutTestController.notifyDone()'
+        document.body.appendChild(scriptElement);
+    }
+}
+</script>
+</body>
+</html>
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToDouble-001.js b/LayoutTests/java/lc3/ConvertJSObject/ToDouble-001.js
new file mode 100644 (file)
index 0000000..106013f
--- /dev/null
@@ -0,0 +1,74 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ *
+ * Copyright (C) 1998 Netscape Communications Corporation.
+ * Copyright (C) 2010 Apple Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestfile = 'ToDouble-001.js';
+
+/**
+ *  Preferred Argument Conversion.
+ *
+ *  Passing a JavaScript boolean to a Java method should prefer to call
+ *  a Java method of the same name that expects a Java boolean.
+ *
+ */
+var SECTION = "Preferred argument conversion: JavaScript object to double";
+var VERSION = "1_4";
+var TITLE   = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " +
+  SECTION;
+startTest();
+
+var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.jsobject.JSObject_004");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new String() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Boolean() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Number() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Date() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Function() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( this ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new RegExp() ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( Math ) +''",
+  "'DOUBLE'");
+
+shouldBeWithErrorCheck(
+  "TEST_CLASS.ambiguous( new Object() ) +''",
+  "'DOUBLE'");
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToFloat-001-expected.txt b/LayoutTests/java/lc3/ConvertJSObject/ToFloat-001-expected.txt
new file mode 100644 (file)
index 0000000..900cb29
--- /dev/null
@@ -0,0 +1,15 @@
+LiveConnect 3.0 JavaScript to Java Data Type Conversion Preferred argument conversion:  boolean
+
+FAIL TEST_CLASS.ambiguous( new String() ) +'' should be FLOAT. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Boolean() ) +'' should be FLOAT. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Number() ) +'' should be FLOAT. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Date() ) +'' should be FLOAT. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Function() ) +'' should be FLOAT. Was BYTE.
+FAIL TEST_CLASS.ambiguous( this ) +'' should be FLOAT. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new RegExp() ) +'' should be FLOAT. Was BYTE.
+FAIL TEST_CLASS.ambiguous( Math ) +'' should be FLOAT. Was BYTE.
+FAIL TEST_CLASS.ambiguous( new Object() ) +'' should be FLOAT. Was BYTE.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/java/lc3/ConvertJSObject/ToFloat-001.html b/LayoutTests/java/lc3/ConvertJSObject/ToFloat-001.html
new file mode 100644 (file)
index 0000000..f3d3d31
--- /dev/null
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css">
+<script src="../../../fast/js/resources/js-test-pre.js"></script>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.overridePreference("WebKitJavaEnabled", "1");
+    layoutTestController.waitUntilDone();
+}
+</script>
+</head>
+<body onload="onload()">
+
+<div id="console"></div>
+
+<object
+  classid="clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA"