[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / plugins / netscape-plugin-property-access-exception.html
1 <html><body>
2 <embed name="plg" type="application/x-webkit-test-netscape"></embed>
3 <div id="getter">FAILURE: No exception caught on getting.</div>
4 <div id="setter">FAILURE: No exception caught on setting.</div>
5 <em>One could expect exceptions to be raised in the below cases, too - but Firefox doesn't
6 do that in most of these (I do get an exception in the first case, but that's inconsistent with not
7 getting it in the seconfd one).</em>
8 <div id="getter2">No exception caught on getting via testCallback.</div>
9 <div id="setter2">No exception caught on setting via testCallback.</div>
10 <div id="getter3">No exception caught on getting via testGetBrowserProperty.</div>
11 <div id="setter3">No exception caught on setting via testSetBrowserProperty.</div>
12 <script>
13     if (window.layoutTestController)
14         layoutTestController.dumpAsText();
15
16     var plg = document.getElementsByName("plg")[0];
17
18     // Firefox sometimes behaves inconsistently, leaving an exception dangling until the next call.
19     function sanityCheckExceptionState(logTarget)
20     {
21         try {
22             plg.testEvaluate("");
23         } catch (e) {
24             document.getElementById(logTarget).innerHTML += " Huh? Exception raised later!";
25         }
26     }
27
28     try {
29         plg.testThrowExceptionProperty;
30     } catch (e) {
31         document.getElementById('getter').innerHTML = 'SUCCESS: Exception caught: ' + e;
32     }
33     sanityCheckExceptionState("getter");
34
35     try {
36         plg.testThrowExceptionProperty = "";
37     } catch (e) {
38         document.getElementById('setter').innerHTML = 'SUCCESS: Exception caught: ' + e;
39     }
40     sanityCheckExceptionState("setter");
41
42     try {
43         plg.testEvaluate("plg.testThrowExceptionProperty");
44     } catch (e) {
45         document.getElementById('getter2').innerHTML = 'Exception caught: ' + e;
46     }
47     sanityCheckExceptionState("getter2");
48
49     try {
50         plg.testEvaluate("plg.testThrowExceptionProperty = 0");
51     } catch (e) {
52         document.getElementById('setter2').innerHTML = 'Exception caught: ' + e;
53     }
54     sanityCheckExceptionState("setter2");
55
56     try {
57         plg.testGetBrowserProperty(plg, "testThrowExceptionProperty");
58     } catch (e) {
59         document.getElementById('getter3').innerHTML = 'Exception caught: ' + e;
60     }
61     sanityCheckExceptionState("getter3");
62
63     try {
64         plg.testSetBrowserProperty(plg, "testThrowExceptionProperty", 0);
65     } catch (e) {
66         document.getElementById('setter3').innerHTML = 'Exception caught: ' + e;
67     }
68     sanityCheckExceptionState("setter3");
69 </script>
70 </body>
71 </html>