|
1 <html> |
|
2 |
|
3 <head> |
|
4 <title>Accessible events testing for ARIA document</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 //////////////////////////////////////////////////////////////////////////// |
|
23 // Invokers |
|
24 |
|
25 function showARIADialog(aID) |
|
26 { |
|
27 this.dialogNode = getNode(aID); |
|
28 |
|
29 this.eventSeq = [ |
|
30 new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, this.dialogNode) |
|
31 ]; |
|
32 |
|
33 this.invoke = function showARIADialog_invoke() |
|
34 { |
|
35 this.dialogNode.style.display = "block"; |
|
36 } |
|
37 |
|
38 this.getID = function showARIADialog_getID() |
|
39 { |
|
40 return "show ARIA dialog"; |
|
41 } |
|
42 } |
|
43 |
|
44 //////////////////////////////////////////////////////////////////////////// |
|
45 // Do tests |
|
46 |
|
47 var gQueue = null; |
|
48 |
|
49 // Debug stuff. |
|
50 //gA11yEventDumpToConsole = true; |
|
51 |
|
52 function doTests() |
|
53 { |
|
54 gQueue = new eventQueue(); |
|
55 |
|
56 gQueue.push(new showARIADialog("dialog")); |
|
57 gQueue.push(new showARIADialog("document")); |
|
58 |
|
59 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
60 } |
|
61 |
|
62 SimpleTest.waitForExplicitFinish(); |
|
63 addA11yLoadEvent(doTests); |
|
64 </script> |
|
65 </head> |
|
66 |
|
67 <body> |
|
68 |
|
69 <a target="_blank" |
|
70 href="https://bugzilla.mozilla.org/show_bug.cgi?id=759833" |
|
71 title="ARIA documents should fire document loading events"> |
|
72 Mozilla Bug 759833 |
|
73 </a> |
|
74 |
|
75 <p id="display"></p> |
|
76 <div id="content" style="display: none"></div> |
|
77 <pre id="test"> |
|
78 </pre> |
|
79 |
|
80 <div role="dialog" id="dialog" style="display: none;">It's a dialog</div> |
|
81 <div role="document" id="document" style="display: none;">It's a document</div> |
|
82 </body> |
|
83 </html> |