gecko/toolkit/spatial-navigation/tests/chrome/test_snav_tightlinks.xul

120 lines
3.1 KiB
Plaintext
Raw Normal View History

2008-07-09 11:17:46 -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"?>
<!--
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>
<script type="application/javascript" src="SpatialNavUtils.js"></script>
2008-07-09 11:17:46 -07:00
<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/SpatialNavigation.js");
2008-07-09 11:17:46 -07:00
var moveTable = [
["DOWN", "5"],
["DOWN", "9"],
["DOWN", "13"],
["UP", "9"],
["UP", "5"],
["UP", "1"],
["RIGHT", "2"],
["DOWN", "6"],
["DOWN", "10"],
["DOWN", "14"],
["UP", "10"],
["UP", "6"],
["UP", "2"],
["RIGHT", "3"],
["DOWN", "7"],
["DOWN", "11"],
["DOWN", "15"],
["UP", "11"],
["UP", "7"],
["UP", "3"],
["RIGHT", "4"],
["DOWN", "8"],
["DOWN", "12"],
["DOWN", "16"],
["UP", "12"],
["UP", "8"],
["UP", "4"],
["DONE", "DONE"]
];
var prefs = [
["enabled", "bool", true],
["xulContentEnabled", "bool", true],
["keyCode.modifier", "char", "none"],
];
2008-07-09 11:17:46 -07:00
function onLoad()
{
prepareTest(prefs);
// starting the test itself.
2008-07-09 11:17:46 -07:00
var x = document.getElementById("some-content");
SpatialNavigation.init(x);
2008-07-09 11:17:46 -07:00
// get to a known place.
document.getElementById("1").focus();
testMoves(moveTable);
2008-07-09 11:17:46 -07:00
SimpleTest.waitForExplicitFinish();
SpatialNavigation.uninit();
2008-07-09 11:17:46 -07:00
}
]]></script>
</window>