WebCore:
[WebKit-https.git] / LayoutTests / plugins / netscape-construct.html
1 <html>
2 <script>
3 function runTest()
4 {
5     if (window.layoutTestController)
6         layoutTestController.dumpAsText();
7         
8     var successCount = 0;
9     var plugin = document.getElementById("testPlugin");
10     
11     var array = plugin.testConstruct(Array, 1, 2, 3, 4);
12     if (array instanceof Array) {
13         successCount++
14         
15         if (array.length == 4)
16             successCount++
17     }
18   
19     var n = new plugin.testObject();
20
21     if (n.objectPointer == plugin.testObject.objectPointer)
22         successCount++;
23
24         
25     if (successCount == 3)
26         document.getElementById('result').innerHTML = 'SUCCESS'
27 }
28 </script>
29
30 <body onload="runTest();">
31 This tests that NPN_Construct works correctly, and that it is possible to use "new" with NPObjects that implement construct.
32
33 <div id="result">FAILURE</div>
34 <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" height="200"></embed>
35 </body>
36 </html>