accessible/tests/mochitest/events/test_focus_controls.html

branch
TOR_BUG_9701
changeset 14
925c144e1f1f
equal deleted inserted replaced
-1:000000000000 0:35b91023f586
1 <html>
2
3 <head>
4 <title>Accessible focus testing on HTML controls</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 //gA11yEventDumpToConsole = true;
25
26 var gQueue = null;
27 function doTests()
28 {
29 gQueue = new eventQueue(EVENT_FOCUS);
30
31 gQueue.push(new synthFocus("textbox"));
32 gQueue.push(new synthFocus("textarea"));
33 gQueue.push(new synthFocus("button1"));
34 gQueue.push(new synthFocus("button2"));
35 gQueue.push(new synthFocus("checkbox"));
36 gQueue.push(new synthFocus("radio1"));
37 gQueue.push(new synthDownKey("radio1", new focusChecker("radio2")));
38
39 // no focus events for checkbox or radio inputs when they are checked
40 // programmatically
41 gQueue.push(new changeCurrentItem("checkbox"));
42 gQueue.push(new changeCurrentItem("radio1"));
43
44 gQueue.invoke(); // Will call SimpleTest.finish();
45 }
46
47 SimpleTest.waitForExplicitFinish();
48 addA11yLoadEvent(doTests);
49 </script>
50 </head>
51
52 <body>
53
54 <a target="_blank"
55 href="https://bugzilla.mozilla.org/show_bug.cgi?id=673958"
56 title="Rework accessible focus handling">
57 Mozilla Bug 673958
58 </a>
59 <p id="display"></p>
60 <div id="content" style="display: none"></div>
61 <pre id="test">
62 </pre>
63
64 <input id="textbox">
65 <textarea id="textarea"></textarea>
66
67 <input id="button1" type="button" value="button">
68 <button id="button2">button</button>
69 <input id="checkbox" type="checkbox">
70 <input id="radio1" type="radio" name="radiogroup">
71 <input id="radio2" type="radio" name="radiogroup">
72
73 <div id="eventdump"></div>
74 </body>
75 </html>

mercurial