1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/events/test_focus_controls.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,75 @@ 1.4 +<html> 1.5 + 1.6 +<head> 1.7 + <title>Accessible focus testing on HTML controls</title> 1.8 + 1.9 + <link rel="stylesheet" type="text/css" 1.10 + href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.11 + 1.12 + <script type="application/javascript" 1.13 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.14 + <script type="application/javascript" 1.15 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.16 + 1.17 + <script type="application/javascript" 1.18 + src="../common.js"></script> 1.19 + <script type="application/javascript" 1.20 + src="../events.js"></script> 1.21 + <script type="application/javascript" 1.22 + src="../role.js"></script> 1.23 + <script type="application/javascript" 1.24 + src="../states.js"></script> 1.25 + 1.26 + <script type="application/javascript"> 1.27 + //gA11yEventDumpToConsole = true; 1.28 + 1.29 + var gQueue = null; 1.30 + function doTests() 1.31 + { 1.32 + gQueue = new eventQueue(EVENT_FOCUS); 1.33 + 1.34 + gQueue.push(new synthFocus("textbox")); 1.35 + gQueue.push(new synthFocus("textarea")); 1.36 + gQueue.push(new synthFocus("button1")); 1.37 + gQueue.push(new synthFocus("button2")); 1.38 + gQueue.push(new synthFocus("checkbox")); 1.39 + gQueue.push(new synthFocus("radio1")); 1.40 + gQueue.push(new synthDownKey("radio1", new focusChecker("radio2"))); 1.41 + 1.42 + // no focus events for checkbox or radio inputs when they are checked 1.43 + // programmatically 1.44 + gQueue.push(new changeCurrentItem("checkbox")); 1.45 + gQueue.push(new changeCurrentItem("radio1")); 1.46 + 1.47 + gQueue.invoke(); // Will call SimpleTest.finish(); 1.48 + } 1.49 + 1.50 + SimpleTest.waitForExplicitFinish(); 1.51 + addA11yLoadEvent(doTests); 1.52 + </script> 1.53 +</head> 1.54 + 1.55 +<body> 1.56 + 1.57 + <a target="_blank" 1.58 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=673958" 1.59 + title="Rework accessible focus handling"> 1.60 + Mozilla Bug 673958 1.61 + </a> 1.62 + <p id="display"></p> 1.63 + <div id="content" style="display: none"></div> 1.64 + <pre id="test"> 1.65 + </pre> 1.66 + 1.67 + <input id="textbox"> 1.68 + <textarea id="textarea"></textarea> 1.69 + 1.70 + <input id="button1" type="button" value="button"> 1.71 + <button id="button2">button</button> 1.72 + <input id="checkbox" type="checkbox"> 1.73 + <input id="radio1" type="radio" name="radiogroup"> 1.74 + <input id="radio2" type="radio" name="radiogroup"> 1.75 + 1.76 + <div id="eventdump"></div> 1.77 +</body> 1.78 +</html>