|
1 <html> |
|
2 |
|
3 <head> |
|
4 <title>nsIAccessible::focusedChild testing</title> |
|
5 |
|
6 <link rel="stylesheet" type="text/css" |
|
7 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="../role.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="../states.js"></script> |
|
18 <script type="application/javascript" |
|
19 src="../events.js"></script> |
|
20 |
|
21 <script type="application/javascript"> |
|
22 function openWnd() |
|
23 { |
|
24 this.eventSeq = [ new invokerChecker(EVENT_FOCUS, |
|
25 getDialogAccessible, |
|
26 this) ]; |
|
27 |
|
28 this.invoke = function openWnd_invoke() |
|
29 { |
|
30 this.dialog = window.openDialog("about:mozilla", |
|
31 "AboutMozilla", |
|
32 "chrome,width=600,height=600"); |
|
33 } |
|
34 |
|
35 this.finalCheck = function openWnd_finalCheck() |
|
36 { |
|
37 var app = getApplicationAccessible(); |
|
38 is(app.focusedChild, getDialogAccessible(this), |
|
39 "Wrong focused child"); |
|
40 |
|
41 this.dialog.close(); |
|
42 } |
|
43 |
|
44 this.getID = function openWnd_getID() |
|
45 { |
|
46 return "focusedChild for application accessible"; |
|
47 } |
|
48 |
|
49 function getDialogAccessible(aInvoker) |
|
50 { |
|
51 return getAccessible(aInvoker.dialog.document); |
|
52 } |
|
53 } |
|
54 |
|
55 gA11yEventDumpToConsole = true; |
|
56 var gQueue = null; |
|
57 |
|
58 function doTest() |
|
59 { |
|
60 enableLogging("focus,doclifecycle"); |
|
61 gQueue = new eventQueue(); |
|
62 |
|
63 gQueue.push(new openWnd()); |
|
64 |
|
65 gQueue.onFinish = function() { disableLogging(); } |
|
66 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
67 } |
|
68 |
|
69 SimpleTest.waitForExplicitFinish(); |
|
70 addA11yLoadEvent(doTest); |
|
71 </script> |
|
72 </head> |
|
73 |
|
74 <body> |
|
75 |
|
76 <a target="_blank" |
|
77 href="https://bugzilla.mozilla.org/show_bug.cgi?id=677467" |
|
78 title="focusedChild crashes on application accessible"> |
|
79 Mozilla Bug 677467 |
|
80 </a> |
|
81 <p id="display"></p> |
|
82 <div id="content" style="display: none"></div> |
|
83 <pre id="test"> |
|
84 </pre> |
|
85 |
|
86 </body> |
|
87 </html> |