3 This test ensures the correctness of Spatial Navigation (SNav) algorithm over single select element.
6 1) DRT support for SNav enable/disable.
9 1) Loads this page, focus goes to "start" automatically.
10 2) Focus moves away from select in 4 different directions to neighbor nodes and back.
13 <script src="../js/resources/js-test-pre.js"></script>
14 <script src="resources/spatial-navigation-utils.js"></script>
15 <script type="application/javascript">
34 if (window.layoutTestController) {
35 layoutTestController.dumpAsText();
36 layoutTestController.setSpatialNavigationEnabled(true);
37 layoutTestController.overridePreference("WebKitTabToLinksPreferenceKey", 1);
38 layoutTestController.waitUntilDone();
43 // starting the test itself: get to a known place.
44 document.getElementById("start").focus();
46 initTest(resultMap, additionalTest);
49 function additionalTest()
51 document.getElementById("start").focus();
52 shouldBe("gFocusedDocument.getElementById(\"start\").selectedIndex", "0");
53 eventSender.keyDown(" ");
54 eventSender.keyDown("downArrow");
55 shouldBe("gFocusedDocument.getElementById(\"start\").selectedIndex", "1");
56 eventSender.keyDown("upArrow");
57 shouldBe("gFocusedDocument.getElementById(\"start\").selectedIndex", "0");
62 function testCompleted()
64 if (window.layoutTestController)
65 layoutTestController.notifyDone();
68 window.onload = runTest;
71 <script src="js/resources/js-test-post.js"></script>
73 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
74 <table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1">
77 <td style="vertical-align: top; text-align: center;"></td>
78 <td style="vertical-align: top; text-align: center;"><a id="2" href="a">2</a></td>
79 <td style="vertical-align: top; text-align: center;"></td>
82 <td style="vertical-align: top; text-align: center;"><a id="4" href="a">4</a></td>
83 <td style="vertical-align: top; text-align: center;"><select id="start"><option>1</option><option>2</option><option>3</option></select></td>
84 <td style="vertical-align: top; text-align: center;"><a id="6" href="a">6</a></td>
87 <td style="vertical-align: top; text-align: center;"></td>
88 <td style="vertical-align: top; text-align: center;"><a id="8" href="a">8</a></td>
89 <td style="vertical-align: top; text-align: center;"></td>
93 <div id="console"></div>