2011-07-05 Yuta Kitamura <yutak@chromium.org>
[WebKit-https.git] / LayoutTests / java / inaccessible-class.html
1 <html>
2 <head>
3 <script>
4 if (window.layoutTestController) {
5     layoutTestController.dumpAsText();
6     layoutTestController.overridePreference("WebKitJavaEnabled", "1");
7 }
8 </script>
9 </head>
10 <body>
11
12 <p>Test accessing a field of a non-public class. This may or may not need to work, but it definitely
13 shouldn't crash.</p>
14
15 <pre id="console"></pre>
16 <applet CODE="SharedApplet.class" NAME="javaTest" WIDTH=150 HEIGHT=25 MAYSCRIPT></applet>
17 <script>
18 function log(message)
19 {
20     document.getElementById("console").innerHTML += message;
21 }
22
23 try {
24     var result = document.javaTest.getObjectOfNonPublicClass().arrayField[0];
25     if (result == 5)
26         log("PASS");
27     else
28         log("FAIL: result is " + result);
29 } catch (ex) {
30     if (window.layoutTestController)
31         log("FAIL: Exception raised");
32     else
33         log(ex);
34 }
35 </script>
36 </body>
37 </html>