2009-05-13 22:50:17 -07:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
|
|
|
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
|
|
|
type="text/css"?>
|
|
|
|
|
|
|
|
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
|
|
|
title="Accessible focus event testing">
|
|
|
|
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/MochiKit/packed.js" />
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
|
2010-03-17 22:44:57 -07:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
|
2009-05-13 22:50:17 -07:00
|
|
|
|
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../common.js" />
|
2009-05-13 22:50:17 -07:00
|
|
|
<script type="application/javascript"
|
2010-09-01 15:09:56 -07:00
|
|
|
src="../events.js" />
|
2009-05-13 22:50:17 -07:00
|
|
|
|
|
|
|
<script type="application/javascript">
|
|
|
|
/**
|
2010-03-17 22:44:57 -07:00
|
|
|
* Click menu item invoker.
|
2009-05-13 22:50:17 -07:00
|
|
|
*/
|
2010-03-17 22:44:57 -07:00
|
|
|
function clickMenuItem(aNodeOrID, aFocusNodeOrID)
|
2009-05-13 22:50:17 -07:00
|
|
|
{
|
2010-03-17 22:44:57 -07:00
|
|
|
this.DOMNode = getNode(aFocusNodeOrID);
|
2009-05-13 22:50:17 -07:00
|
|
|
|
2010-03-17 22:44:57 -07:00
|
|
|
this.invoke = function clickMenuItem_invoke()
|
2009-05-13 22:50:17 -07:00
|
|
|
{
|
2010-03-17 22:44:57 -07:00
|
|
|
synthesizeMouse(getNode(aNodeOrID), 1, 1, {});
|
2009-05-13 22:50:17 -07:00
|
|
|
}
|
|
|
|
|
2010-03-17 22:44:57 -07:00
|
|
|
this.getID = function clickMenuItem_getID()
|
|
|
|
{
|
|
|
|
return prettyName(aNodeOrID) + " click menu item";
|
|
|
|
}
|
2009-05-13 22:50:17 -07:00
|
|
|
}
|
2010-03-17 22:44:57 -07:00
|
|
|
|
2009-05-13 22:50:17 -07:00
|
|
|
/**
|
|
|
|
* Do tests.
|
|
|
|
*/
|
2010-03-17 22:44:57 -07:00
|
|
|
|
2010-10-15 08:34:35 -07:00
|
|
|
//gA11yEventDumpID = "eventdump"; // debug stuff
|
2010-03-17 22:44:57 -07:00
|
|
|
|
2009-05-13 22:50:17 -07:00
|
|
|
var gQueue = null;
|
|
|
|
|
|
|
|
function doTests()
|
|
|
|
{
|
|
|
|
// Test focus events.
|
|
|
|
gQueue = new eventQueue(nsIAccessibleEvent.EVENT_FOCUS);
|
|
|
|
|
|
|
|
gQueue.push(new synthFocus("textbox"));
|
|
|
|
gQueue.push(new synthFocus("scale"));
|
2010-03-17 22:44:57 -07:00
|
|
|
gQueue.push(new synthFocusOnFrame("editabledoc"));
|
|
|
|
gQueue.push(new synthClick("menu"));
|
|
|
|
gQueue.push(new synthMouseMove("menuitem"));
|
|
|
|
gQueue.push(new clickMenuItem("menuitem",
|
|
|
|
getNode("editabledoc").contentDocument));
|
2009-05-13 22:50:17 -07:00
|
|
|
|
|
|
|
gQueue.invoke(); // Will call SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTests);
|
2009-05-13 22:50:17 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<hbox flex="1" style="overflow: auto;">
|
|
|
|
<body xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=492518"
|
|
|
|
title="xul:slider accessible of xul:scale is accessible illegally">
|
|
|
|
Mozilla Bug 492518
|
|
|
|
</a>
|
2010-03-17 22:44:57 -07:00
|
|
|
<a target="_blank"
|
|
|
|
href="https://bugzilla.mozilla.org/show_bug.cgi?id=552368"
|
|
|
|
title=" fire focus event on document accessible whenever the root or body element is focused">
|
|
|
|
Mozilla Bug 552368
|
|
|
|
</a>
|
2009-05-13 22:50:17 -07:00
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
<vbox flex="1">
|
|
|
|
<textbox id="textbox" value="hello"/>
|
|
|
|
<scale id="scale" min="0" max="9" value="5"/>
|
2010-03-17 22:44:57 -07:00
|
|
|
<menubar>
|
|
|
|
<menu id="menu" label="menu">
|
|
|
|
<menupopup>
|
|
|
|
<menuitem id="menuitem" label="menuitem"/>
|
|
|
|
</menupopup>
|
|
|
|
</menu>
|
|
|
|
</menubar>
|
|
|
|
<iframe id="editabledoc" src="focus.html"/>
|
|
|
|
|
|
|
|
<vbox id="eventdump"/>
|
2009-05-13 22:50:17 -07:00
|
|
|
</vbox>
|
|
|
|
</hbox>
|
|
|
|
</window>
|