accessible/tests/mochitest/events/test_focus_controls.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <html>
michael@0 2
michael@0 3 <head>
michael@0 4 <title>Accessible focus testing on HTML controls</title>
michael@0 5
michael@0 6 <link rel="stylesheet" type="text/css"
michael@0 7 href="chrome://mochikit/content/tests/SimpleTest/test.css" />
michael@0 8
michael@0 9 <script type="application/javascript"
michael@0 10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
michael@0 11 <script type="application/javascript"
michael@0 12 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
michael@0 13
michael@0 14 <script type="application/javascript"
michael@0 15 src="../common.js"></script>
michael@0 16 <script type="application/javascript"
michael@0 17 src="../events.js"></script>
michael@0 18 <script type="application/javascript"
michael@0 19 src="../role.js"></script>
michael@0 20 <script type="application/javascript"
michael@0 21 src="../states.js"></script>
michael@0 22
michael@0 23 <script type="application/javascript">
michael@0 24 //gA11yEventDumpToConsole = true;
michael@0 25
michael@0 26 var gQueue = null;
michael@0 27 function doTests()
michael@0 28 {
michael@0 29 gQueue = new eventQueue(EVENT_FOCUS);
michael@0 30
michael@0 31 gQueue.push(new synthFocus("textbox"));
michael@0 32 gQueue.push(new synthFocus("textarea"));
michael@0 33 gQueue.push(new synthFocus("button1"));
michael@0 34 gQueue.push(new synthFocus("button2"));
michael@0 35 gQueue.push(new synthFocus("checkbox"));
michael@0 36 gQueue.push(new synthFocus("radio1"));
michael@0 37 gQueue.push(new synthDownKey("radio1", new focusChecker("radio2")));
michael@0 38
michael@0 39 // no focus events for checkbox or radio inputs when they are checked
michael@0 40 // programmatically
michael@0 41 gQueue.push(new changeCurrentItem("checkbox"));
michael@0 42 gQueue.push(new changeCurrentItem("radio1"));
michael@0 43
michael@0 44 gQueue.invoke(); // Will call SimpleTest.finish();
michael@0 45 }
michael@0 46
michael@0 47 SimpleTest.waitForExplicitFinish();
michael@0 48 addA11yLoadEvent(doTests);
michael@0 49 </script>
michael@0 50 </head>
michael@0 51
michael@0 52 <body>
michael@0 53
michael@0 54 <a target="_blank"
michael@0 55 href="https://bugzilla.mozilla.org/show_bug.cgi?id=673958"
michael@0 56 title="Rework accessible focus handling">
michael@0 57 Mozilla Bug 673958
michael@0 58 </a>
michael@0 59 <p id="display"></p>
michael@0 60 <div id="content" style="display: none"></div>
michael@0 61 <pre id="test">
michael@0 62 </pre>
michael@0 63
michael@0 64 <input id="textbox">
michael@0 65 <textarea id="textarea"></textarea>
michael@0 66
michael@0 67 <input id="button1" type="button" value="button">
michael@0 68 <button id="button2">button</button>
michael@0 69 <input id="checkbox" type="checkbox">
michael@0 70 <input id="radio1" type="radio" name="radiogroup">
michael@0 71 <input id="radio2" type="radio" name="radiogroup">
michael@0 72
michael@0 73 <div id="eventdump"></div>
michael@0 74 </body>
michael@0 75 </html>

mercurial