Reviewed by Geoff.
authortomernic <tomernic@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Mar 2006 00:13:46 +0000 (00:13 +0000)
committertomernic <tomernic@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Mar 2006 00:13:46 +0000 (00:13 +0000)
        Test case for issues surrounding <rdar://problem/4212626> REGRESSION: LIVECONNECT:
        JavaScript type for Java Strings is function, not object

        Unfortunately, I can only test C and ObjC instances; Java does not run correctly
        in DumpRenderTree.

        * plugins/bindings-test/bindings-test.html: Added.
        * plugins/bindings-test/bindings-test-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/plugins/bindings-test-expected.txt [new file with mode: 0644]
LayoutTests/plugins/bindings-test.html [new file with mode: 0644]

index 15883df..50348bd 100644 (file)
@@ -1,3 +1,16 @@
+2006-03-30  Tim Omernick  <timo@apple.com>
+
+        Reviewed by Geoff.
+        
+        Test case for issues surrounding <rdar://problem/4212626> REGRESSION: LIVECONNECT:
+        JavaScript type for Java Strings is function, not object
+
+        Unfortunately, I can only test C and ObjC instances; Java does not run correctly
+        in DumpRenderTree.
+
+        * plugins/bindings-test/bindings-test.html: Added.
+        * plugins/bindings-test/bindings-test-expected.txt: Added.
+
 2006-03-30  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by darin
diff --git a/LayoutTests/plugins/bindings-test-expected.txt b/LayoutTests/plugins/bindings-test-expected.txt
new file mode 100644 (file)
index 0000000..bb2cb72
--- /dev/null
@@ -0,0 +1,11 @@
+ALERT: typeof(objCPlugin)=object
+ALERT: objCPlugin()=TypeError
+ALERT: typeof(objCPluginFunction)=function
+ALERT: objCPluginFunction()=test
+ALERT: typeof(cPlugin)=function
+ALERT: cPlugin()=1
+ALERT: typeof(cPlugin)=object
+ALERT: cPlugin()=TypeError
+This page tests invoking as functions JavaScript objects that are provided by plugins.
+
+
diff --git a/LayoutTests/plugins/bindings-test.html b/LayoutTests/plugins/bindings-test.html
new file mode 100644 (file)
index 0000000..59fa8b5
--- /dev/null
@@ -0,0 +1,75 @@
+<html>
+<head>
+<script>
+function doTest()
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    if (window.objCPlugin) {
+        // Type should be "object"
+        alert("typeof(objCPlugin)=" + typeof(objCPlugin));
+
+        // Calling objCPlugin() should raise an exception.
+        var result;
+        try {
+            result = objCPlugin();
+        } catch (e) {
+            result = e.name;
+        }
+        alert("objCPlugin()=" + result);
+    }
+
+    if (window.objCPluginFunction) {
+        // Type should be "function"
+        alert("typeof(objCPluginFunction)=" + typeof(objCPluginFunction));
+
+        // Calling objCPluginFunction() should return "test"
+        var result;
+        try {
+            result = objCPluginFunction();
+        } catch (e) {
+            result = e.name;
+        }
+        alert("objCPluginFunction()=" + result);
+    }
+    
+    // Test the C plugin
+    var cPlugin = document.getElementById("testCPlugin");
+    if (cPlugin) {
+        // Type should be "function"
+        alert("typeof(cPlugin)=" + typeof(cPlugin));
+        
+        // Calling cPlugin() should return 1
+        var result;
+        try {
+            result = cPlugin();
+        } catch (e) {
+            result = e.name;
+        }
+        alert("cPlugin()=" + result);
+
+        // Special function that removes cPlugin's default method implementation.  The runtime should consider
+        // cPlugin an "object" if it has no default method.
+        cPlugin.removeDefaultMethod();
+
+        // Type should be "object"
+        alert("typeof(cPlugin)=" + typeof(cPlugin));
+        
+        // Calling cPlugin() now should raise an exception
+        var result;
+        try {
+            result = cPlugin();
+        } catch (e) {
+            result = e.name;
+        }
+        alert("cPlugin()=" + result);
+    }
+}
+</script>
+</head>
+<body onload="doTest();">
+<p>This page tests invoking as functions JavaScript objects that are provided by plugins.</p>
+<embed id="testCPlugin" type="application/x-webkit-test-netscape"></embed>
+</body>
+</html>