|
1 <html> |
|
2 <!-- |
|
3 https://bugzilla.mozilla.org/show_bug.cgi?id=441519 |
|
4 --> |
|
5 <head> |
|
6 <title>nsOuterDocAccessible chrome tests</title> |
|
7 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> |
|
8 |
|
9 <script type="application/javascript" |
|
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
11 |
|
12 <script type="application/javascript" |
|
13 src="common.js"></script> |
|
14 <script type="application/javascript" |
|
15 src="states.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="role.js"></script> |
|
18 |
|
19 <script type="application/javascript"> |
|
20 // needed error return value |
|
21 const ns_error_invalid_arg = Components.results.NS_ERROR_INVALID_ARG; |
|
22 |
|
23 function doTest() |
|
24 { |
|
25 // Get accessible for body tag. |
|
26 var docAcc = getAccessible(document); |
|
27 |
|
28 if (docAcc) { |
|
29 var outerDocAcc = getAccessible(docAcc.parent); |
|
30 |
|
31 if (outerDocAcc) { |
|
32 testRole(outerDocAcc, ROLE_INTERNAL_FRAME); |
|
33 |
|
34 // check if it is focusable. |
|
35 testStates(outerDocAcc, STATE_FOCUSABLE, 0); |
|
36 |
|
37 // see bug 428954: No name wanted for internal frame |
|
38 is(outerDocAcc.name, null, "Wrong name for internal frame!"); |
|
39 |
|
40 // see bug 440770, no actions wanted on outer doc |
|
41 is(outerDocAcc.actionCount, 0, |
|
42 "Wrong number of actions for internal frame!"); |
|
43 var actionTempStr; // not really used, just needs to receive a value |
|
44 try { |
|
45 actionTempStr = outerDocAcc.getActionName(0); |
|
46 do_throw("No exception thrown for actionName!"); |
|
47 } catch(e) { |
|
48 ok(e.result, ns_error_invalid_arg, |
|
49 "Wrong return value for actionName call!"); |
|
50 } |
|
51 |
|
52 try { |
|
53 actionTempStr = outerDocAcc.getActionDescription(0); |
|
54 do_throw("No exception thrown for actionDescription!"); |
|
55 } catch(e) { |
|
56 ok(e.result, ns_error_invalid_arg, |
|
57 "Wrong return value for actionDescription call!"); |
|
58 } |
|
59 |
|
60 try { |
|
61 outerDocAcc.doAction(0); |
|
62 do_throw("No exception thrown for doAction!"); |
|
63 } catch(e) { |
|
64 ok(e.result, ns_error_invalid_arg, |
|
65 "Wrong return value for doAction call!"); |
|
66 } |
|
67 } |
|
68 } |
|
69 |
|
70 SimpleTest.finish(); |
|
71 } |
|
72 |
|
73 SimpleTest.waitForExplicitFinish(); |
|
74 addA11yLoadEvent(doTest); |
|
75 </script> |
|
76 </head> |
|
77 <body> |
|
78 |
|
79 <a target="_blank" |
|
80 href="https://bugzilla.mozilla.org/show_bug.cgi?id=441519" |
|
81 title="nsOuterDocAccessible chrome tests"> |
|
82 Mozilla Bug 441519 |
|
83 </a> |
|
84 <p id="display"></p> |
|
85 <div id="content" style="display: none"></div> |
|
86 <pre id="test"> |
|
87 </pre> |
|
88 </body> |
|
89 </html> |