java/java-and-plugins.html test failing
[WebKit-https.git] / LayoutTests / java / java-and-plugins.html
1 <html>
2 <head>
3 <meta charset="utf-8">
4 <script src="../fast/js/resources/js-test-pre.js"></script>
5 <script>
6 if (window.layoutTestController)
7     layoutTestController.overridePreference("WebKitJavaEnabled", "1");
8 </script>
9 </head>
10 <body>
11
12 <p>Test that Java objects can be passed to NPAPI plug-ins, and vice versa.</p>
13 <p>Some tests below are written in a way that works around issues with preserving object identity.
14 They can be simplified once these issues are fixed.</p>
15
16 <div id="console"></div>
17 <embed name="plg" type="application/x-webkit-test-netscape"></embed>
18 <applet CODE="SharedApplet.class" NAME="javaTest" WIDTH=150 HEIGHT=25 MAYSCRIPT></applet>
19 <script>
20
21 document.plg.remember(document.javaTest.getSelf());
22 shouldBe('document.plg.getAndForgetRememberedObject() + ""', 'document.javaTest.getSelf() + ""');
23 document.plg.remember(document.javaTest.getSelf());
24 shouldBe('document.plg.getAndForgetRememberedObject().getSelf().getSelf() + ""', 'document.javaTest.getSelf() + ""');
25
26 shouldBe('document.plg.testHasMethod(document.javaTest, "getSelf")', 'true');
27 shouldBe('document.plg.testHasMethod(document.javaTest, "doesNotExist")', 'false');
28 shouldBe('document.plg.testHasMethod(document.javaTest.getSelf(), "getSelf")', 'true');
29 shouldBe('document.plg.testHasMethod(document.javaTest.getSelf(), "doesNotExist")', 'false');
30
31 document.javaTest.remember(document.plg.testObject);
32 shouldBe('document.javaTest.getAndForgetRememberedObject().objectPointer', 'document.plg.testObject.objectPointer');
33
34 shouldBe('typeof document.javaTest.testGetMember(document.plg, "testDOMAccess")', '"function"');
35
36 </script>
37 <script src="../fast/js/resources/js-test-post.js"></script>
38 </body>
39 </html>