adding file for bug 444384. r=gavin

This commit is contained in:
Doug Turner 2008-07-09 11:17:46 -07:00
parent 9c7252f24c
commit 37cf7255e4

View File

@ -0,0 +1,118 @@
<?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"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=436084
-->
<window title="Mozilla Bug 288254"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<a id="start" href="https://bugzilla.mozilla.org/show_bug.cgi?id=436084">Mozilla Bug 436084 (roxama test case)</a>
<table>
<tbody>
<tr>
<td style="font-size: small;"><a id="1" href="a">Link</a></td>
<td style="font-size: small;"><a id="2" href="a">Link</a></td>
<td style="font-size: small;"><a id="3" href="a">Link</a></td>
<td style="font-size: small;"><a id="4" href="a">Link</a></td>
</tr>
<tr>
<td style="font-size: small;"><a id="5" href="a">Link</a></td>
<td style="font-size: small;"><a id="6" href="a">Link</a></td>
<td style="font-size: small;"><a id="7" href="a">Link</a></td>
<td style="font-size: small;"><a id="8" href="a">Link</a></td>
</tr>
<tr>
<td style="font-size: small;"><a id="9" href="a">Link</a></td>
<td style="font-size: small;"><a id="10" href="a">Link</a></td>
<td style="font-size: small;"><a id="11" href="a">Link</a></td>
<td style="font-size: small;"><a id="12" href="a">Link</a></td>
</tr>
<tr>
<td style="font-size: small;"><a id="13" href="a">Link</a></td>
<td style="font-size: small;"><a id="14" href="a">Link</a></td>
<td style="font-size: small;"><a id="15" href="a">Link</a></td>
<td style="font-size: small;"><a id="16" href="a">Link</a></td>
</tr>
</tbody>
</table>
</body>
<script class="testbody" type="application/javascript">
<![CDATA[
Components.utils.import("resource://gre/modules/spatial-navigation.js");
function onLoad()
{
var x = document.getElementById("some-content");
var snav = new SpatialNavigation(x);
function moveAndVerify(direction, value)
{
sendKey(direction, document.activeElement);
ok(document.activeElement.getAttribute("id") == value, "Move");
}
// get to a known place.
document.getElementById("1").focus();
ok(document.activeElement.getAttribute("id") == "1", "Were we able to focus the starting point?");
moveAndVerify("DOWN", "5");
moveAndVerify("DOWN", "9");
moveAndVerify("DOWN", "13");
moveAndVerify("UP", "9");
moveAndVerify("UP", "5");
moveAndVerify("UP", "1");
moveAndVerify("RIGHT", "2");
moveAndVerify("DOWN", "6");
moveAndVerify("DOWN", "10");
moveAndVerify("DOWN", "14");
moveAndVerify("UP", "10");
moveAndVerify("UP", "6");
moveAndVerify("UP", "2");
moveAndVerify("RIGHT", "3");
moveAndVerify("DOWN", "7");
moveAndVerify("DOWN", "11");
moveAndVerify("DOWN", "15");
moveAndVerify("UP", "11");
moveAndVerify("UP", "7");
moveAndVerify("UP", "3");
moveAndVerify("RIGHT", "4");
moveAndVerify("DOWN", "8");
moveAndVerify("DOWN", "12");
moveAndVerify("DOWN", "16");
moveAndVerify("UP", "12");
moveAndVerify("UP", "8");
moveAndVerify("UP", "4");
SimpleTest.finish();
}
]]></script>
</window>