|
1 <html> |
|
2 |
|
3 <head> |
|
4 <title>Accessible selection event 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 <script type="application/javascript" |
|
12 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> |
|
13 |
|
14 <script type="application/javascript" |
|
15 src="../common.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="../events.js"></script> |
|
18 <script type="application/javascript" |
|
19 src="../role.js"></script> |
|
20 <script type="application/javascript" |
|
21 src="../states.js"></script> |
|
22 |
|
23 <script type="application/javascript"> |
|
24 //////////////////////////////////////////////////////////////////////////// |
|
25 // Invokers |
|
26 |
|
27 //////////////////////////////////////////////////////////////////////////// |
|
28 // Do tests |
|
29 |
|
30 //gA11yEventDumpToConsole = true; // debuggin |
|
31 |
|
32 var gQueue = null; |
|
33 function doTests() |
|
34 { |
|
35 gQueue = new eventQueue(); |
|
36 |
|
37 // open combobox |
|
38 gQueue.push(new synthClick("combobox", |
|
39 new invokerChecker(EVENT_FOCUS, "cb1_item1"))); |
|
40 gQueue.push(new synthDownKey("cb1_item1", |
|
41 selChangeSeq("cb1_item1", "cb1_item2"))); |
|
42 |
|
43 // closed combobox |
|
44 gQueue.push(new synthEscapeKey("combobox", |
|
45 new invokerChecker(EVENT_FOCUS, "combobox"))); |
|
46 gQueue.push(new synthDownKey("cb1_item2", |
|
47 selChangeSeq("cb1_item2", "cb1_item3"))); |
|
48 |
|
49 // listbox |
|
50 gQueue.push(new synthClick("lb1_item1", |
|
51 new invokerChecker(EVENT_SELECTION, "lb1_item1"))); |
|
52 gQueue.push(new synthDownKey("lb1_item1", |
|
53 selChangeSeq("lb1_item1", "lb1_item2"))); |
|
54 |
|
55 // multiselectable listbox |
|
56 gQueue.push(new synthClick("lb2_item1", |
|
57 selChangeSeq(null, "lb2_item1"))); |
|
58 gQueue.push(new synthDownKey("lb2_item1", |
|
59 selAddSeq("lb2_item2"), |
|
60 { shiftKey: true })); |
|
61 gQueue.push(new synthUpKey("lb2_item2", |
|
62 selRemoveSeq("lb2_item2"), |
|
63 { shiftKey: true })); |
|
64 gQueue.push(new synthKey("lb2_item1", " ", { ctrlKey: true }, |
|
65 selRemoveSeq("lb2_item1"))); |
|
66 |
|
67 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
68 } |
|
69 |
|
70 SimpleTest.waitForExplicitFinish(); |
|
71 addA11yLoadEvent(doTests); |
|
72 </script> |
|
73 </head> |
|
74 |
|
75 <body> |
|
76 |
|
77 <a target="_blank" |
|
78 href="https://bugzilla.mozilla.org/show_bug.cgi?id=414302" |
|
79 title="Incorrect selection events in HTML, XUL and ARIA"> |
|
80 Bug 414302 |
|
81 </a> |
|
82 <a target="_blank" |
|
83 href="https://bugzilla.mozilla.org/show_bug.cgi?id=810268" |
|
84 title="There's no way to know unselected item when selection in single selection was changed"> |
|
85 Bug 810268 |
|
86 </a> |
|
87 |
|
88 <p id="display"></p> |
|
89 <div id="content" style="display: none"></div> |
|
90 <pre id="test"> |
|
91 </pre> |
|
92 |
|
93 <select id="combobox"> |
|
94 <option id="cb1_item1" value="mushrooms">mushrooms |
|
95 <option id="cb1_item2" value="greenpeppers">green peppers |
|
96 <option id="cb1_item3" value="onions" id="onions">onions |
|
97 <option id="cb1_item4" value="tomatoes">tomatoes |
|
98 <option id="cb1_item5" value="olives">olives |
|
99 </select> |
|
100 |
|
101 <select id="listbox" size=5> |
|
102 <option id="lb1_item1" value="mushrooms">mushrooms |
|
103 <option id="lb1_item2" value="greenpeppers">green peppers |
|
104 <option id="lb1_item3" value="onions" id="onions">onions |
|
105 <option id="lb1_item4" value="tomatoes">tomatoes |
|
106 <option id="lb1_item5" value="olives">olives |
|
107 </select> |
|
108 |
|
109 <p>Pizza</p> |
|
110 <select id="listbox2" multiple size=5> |
|
111 <option id="lb2_item1" value="mushrooms">mushrooms |
|
112 <option id="lb2_item2" value="greenpeppers">green peppers |
|
113 <option id="lb2_item3" value="onions" id="onions">onions |
|
114 <option id="lb2_item4" value="tomatoes">tomatoes |
|
115 <option id="lb2_item5" value="olives">olives |
|
116 </select> |
|
117 |
|
118 <div id="eventdump"></div> |
|
119 </body> |
|
120 </html> |