Reviewed by Geoff Garen.
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2007 23:57:03 +0000 (23:57 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Sep 2007 23:57:03 +0000 (23:57 +0000)
        Split out mac specific tests from plugins/bindings-test.html into its own test.

        * platform/mac/plugins/bindings-test-objc-expected.txt: Added.
        * platform/mac/plugins/bindings-test-objc.html: Copied from plugins/bindings-test.html.
        * platform/win/Skipped:
        * plugins/bindings-test-expected.txt:
        * plugins/bindings-test.html:

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/plugins/bindings-test-objc-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/plugins/bindings-test-objc.html [new file with mode: 0644]
LayoutTests/platform/win/Skipped
LayoutTests/plugins/bindings-test-expected.txt
LayoutTests/plugins/bindings-test.html

index d47e564..a8e0d1d 100644 (file)
@@ -1,3 +1,15 @@
+2007-09-05  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Geoff Garen.
+
+        Split out mac specific tests from plugins/bindings-test.html into its own test.
+
+        * platform/mac/plugins/bindings-test-objc-expected.txt: Added.
+        * platform/mac/plugins/bindings-test-objc.html: Copied from plugins/bindings-test.html.
+        * platform/win/Skipped:
+        * plugins/bindings-test-expected.txt:
+        * plugins/bindings-test.html:
+
 2007-09-05  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Adam and Niko.
 2007-09-05  Oliver Hunt  <oliver@apple.com>
 
         Reviewed by Adam and Niko.
diff --git a/LayoutTests/platform/mac/plugins/bindings-test-objc-expected.txt b/LayoutTests/platform/mac/plugins/bindings-test-objc-expected.txt
new file mode 100644 (file)
index 0000000..24b04d2
--- /dev/null
@@ -0,0 +1,19 @@
+ALERT: typeof(objCPlugin)=object
+ALERT: objCPlugin()=TypeError
+ALERT: typeof(objCPluginFunction)=function
+ALERT: objCPluginFunction()=test
+ALERT: hello = hello (same)
+ALERT: string = string (same)
+ALERT: 42 = 42 (same)
+ALERT: number = number (same)
+ALERT: null = undefined (same)
+ALERT: object = undefined (different)
+ALERT: undefined = undefined (same)
+ALERT: undefined = undefined (same)
+ALERT: one,two = one,two (same)
+ALERT: object = object (same)
+ALERT: String Hello == Hello
+ALERT: String Not Hello != Hello
+This page tests invoking as functions JavaScript objects that are provided by objective-c plugins.
+
+
diff --git a/LayoutTests/platform/mac/plugins/bindings-test-objc.html b/LayoutTests/platform/mac/plugins/bindings-test-objc.html
new file mode 100644 (file)
index 0000000..fe93cf9
--- /dev/null
@@ -0,0 +1,74 @@
+<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);
+
+        function echoTest(arg) {
+            var echo = objCPlugin.echo(arg);
+            var sameVal = (arg == echo) ? "same" : "different";
+            var sameType = (typeof(arg) == typeof(echo)) ? "same" : "different";
+
+            alert(arg + " = " + echo + " (" + sameVal + ")");
+            alert(typeof(arg) + " = " + typeof(echo) + " (" + sameType + ")");
+        }
+
+        // Test the echo function
+        echoTest("hello");
+        echoTest(42);
+        echoTest(null);
+        echoTest(undefined);
+        echoTest(new Array("one", "two"));
+
+        // Test exceptions
+        function exceptionTest(arg) {
+            try {
+                objCPlugin.throwIfArgumentIsNotHello(arg);
+            } catch (e) {
+                alert("String " + arg + " != Hello");
+                return;
+            }
+            
+            alert("String " + arg + " == Hello");
+        }
+        
+        exceptionTest("Hello");
+        exceptionTest("Not Hello");
+    }
+}
+</script>
+</head>
+<body onload="doTest();">
+<p>This page tests invoking as functions JavaScript objects that are provided by objective-c plugins.</p>
+<embed id="testCPlugin" type="application/x-webkit-test-netscape"></embed>
+</body>
+</html>
index 2dc61cb..3544d6f 100644 (file)
@@ -365,7 +365,6 @@ http/tests/security/local-JavaScript-from-remote.html
 http/tests/security/local-image-from-remote.html
 
 # No built-in plugin in DRT <rdar://problem/5074411>
 http/tests/security/local-image-from-remote.html
 
 # No built-in plugin in DRT <rdar://problem/5074411>
-plugins/bindings-test.html
 plugins/call-as-function-test.html
 plugins/embed-attributes-setting.html
 plugins/get-url-that-the-resource-load-delegate-will-disallow.html
 plugins/call-as-function-test.html
 plugins/embed-attributes-setting.html
 plugins/get-url-that-the-resource-load-delegate-will-disallow.html
index c8ebc50..a88a281 100644 (file)
@@ -1,23 +1,5 @@
 ALERT: typeof(objCPlugin)=object
 ALERT: objCPlugin()=TypeError
 ALERT: typeof(objCPlugin)=object
 ALERT: objCPlugin()=TypeError
-ALERT: typeof(objCPluginFunction)=function
-ALERT: objCPluginFunction()=test
-ALERT: hello = hello (same)
-ALERT: string = string (same)
-ALERT: 42 = 42 (same)
-ALERT: number = number (same)
-ALERT: null = undefined (same)
-ALERT: object = undefined (different)
-ALERT: undefined = undefined (same)
-ALERT: undefined = undefined (same)
-ALERT: one,two = one,two (same)
-ALERT: object = object (same)
-ALERT: String Hello == Hello
-ALERT: String Not Hello != Hello
-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.
 
 
 This page tests invoking as functions JavaScript objects that are provided by plugins.
 
 
index 0b726d9..2bf5f5d 100644 (file)
@@ -19,83 +19,6 @@ function doTest()
         }
         alert("objCPlugin()=" + result);
     }
         }
         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);
-
-        function echoTest(arg) {
-            var echo = objCPlugin.echo(arg);
-            var sameVal = (arg == echo) ? "same" : "different";
-            var sameType = (typeof(arg) == typeof(echo)) ? "same" : "different";
-
-            alert(arg + " = " + echo + " (" + sameVal + ")");
-            alert(typeof(arg) + " = " + typeof(echo) + " (" + sameType + ")");
-        }
-
-        // Test the echo function
-        echoTest("hello");
-        echoTest(42);
-        echoTest(null);
-        echoTest(undefined);
-        echoTest(new Array("one", "two"));
-        
-        // Test exceptions
-        function exceptionTest(arg) {
-               try {
-                       objCPlugin.throwIfArgumentIsNotHello(arg);
-               } catch (e) {
-                       alert("String " + arg + " != Hello");
-                       return;
-               }
-               
-               alert("String " + arg + " == Hello");
-        }
-        
-        exceptionTest("Hello");
-        exceptionTest("Not Hello");
-    }
-    
-    // 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>
 }
 </script>
 </head>