6 if (window.layoutTestController)
7 layoutTestController.dumpAsText();
9 if (window.objCPlugin) {
10 // Type should be "object"
11 alert("typeof(objCPlugin)=" + typeof(objCPlugin));
13 // Calling objCPlugin() should raise an exception.
16 result = objCPlugin();
20 alert("objCPlugin()=" + result);
23 if (window.objCPluginFunction) {
24 // Type should be "function"
25 alert("typeof(objCPluginFunction)=" + typeof(objCPluginFunction));
27 // Calling objCPluginFunction() should return "test"
30 result = objCPluginFunction();
34 alert("objCPluginFunction()=" + result);
38 var cPlugin = document.getElementById("testCPlugin");
40 // Type should be "function"
41 alert("typeof(cPlugin)=" + typeof(cPlugin));
43 // Calling cPlugin() should return 1
50 alert("cPlugin()=" + result);
52 // Special function that removes cPlugin's default method implementation. The runtime should consider
53 // cPlugin an "object" if it has no default method.
54 cPlugin.removeDefaultMethod();
56 // Type should be "object"
57 alert("typeof(cPlugin)=" + typeof(cPlugin));
59 // Calling cPlugin() now should raise an exception
66 alert("cPlugin()=" + result);
71 <body onload="doTest();">
72 <p>This page tests invoking as functions JavaScript objects that are provided by plugins.</p>
73 <embed id="testCPlugin" type="application/x-webkit-test-netscape"></embed>