gecko/accessible/tests/mochitest/focus/test_takeFocus.html
Alexander Surkov 6a04618807 Bug 673958 - rework accessible focus handling, r=enndeaking, marcoz, tbsaunde, matspal, f=marcoz
--HG--
rename : accessible/tests/mochitest/test_aria_activedescendant.html => accessible/tests/mochitest/events/test_focus_aria_activedescendant.html
rename : accessible/tests/mochitest/events/test_focus.html => accessible/tests/mochitest/events/test_focus_dialog.html
rename : accessible/tests/mochitest/events/test_focusdoc.html => accessible/tests/mochitest/events/test_focus_doc.html
rename : accessible/tests/mochitest/events/test_focus.xul => accessible/tests/mochitest/events/test_focus_general.xul
rename : accessible/tests/mochitest/states/test_comboboxes.xul => accessible/tests/mochitest/states/test_expandable.xul
rename : accessible/tests/mochitest/test_nsIAccessible_selects.html => accessible/tests/mochitest/states/test_selects.html
2011-09-28 10:46:11 +09:00

97 lines
2.7 KiB
HTML

<html>
<head>
<title>nsIAccessible::takeFocus testing</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../states.js"></script>
<script type="application/javascript"
src="../events.js"></script>
<script type="application/javascript">
////////////////////////////////////////////////////////////////////////////
// Test
var gQueue = null;
function takeFocusInvoker(aID)
{
this.accessible = getAccessible(aID);
this.eventSeq = [ new focusChecker(this.accessible) ];
this.invoke = function takeFocusInvoker_invoke()
{
this.accessible.takeFocus();
}
this.getID = function takeFocusInvoker_getID()
{
return "takeFocus for " + prettyName(aID);
}
}
function doTest()
{
gQueue = new eventQueue();
gQueue.push(new takeFocusInvoker("aria-link"));
gQueue.push(new takeFocusInvoker("aria-link2"));
gQueue.push(new takeFocusInvoker("link"));
gQueue.push(new takeFocusInvoker("item2"));
gQueue.push(new takeFocusInvoker("plugin"));
gQueue.push(new takeFocusInvoker(document));
gQueue.invoke(); // Will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=429547"
title="Support aria-activedescendant usage in nsIAccesible::TakeFocus()">
Mozilla Bug 429547
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=452710"
title="nsIAccessible::takeFocus testing">
Mozilla Bug 452710
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=646361"
title="No focus event fired on document when focus is set to the document while focused in a plugin">
Mozilla Bug 646361
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<span id="aria-link" role="link" tabindex="0">link</span>
<span id="aria-link2" role="link" tabindex="0">link</span>
<a id="link" href="">link</span>
<div role="listbox" aria-activedescendant="item1" id="container" tabindex="1">
<div role="listitem" id="item1">item1</div>
<div role="listitem" id="item2">item2</div>
<div role="listitem" id="item3">item3</div>
</div>
<embed id="plugin" type="application/x-test" width="200" height="200" wmode="window"></embed>
</body>
</html>