3 <script src=
"../../resources/js-test.js"></script>
4 <script src=
"resources/spatial-navigation-utils.js"></script>
6 <body id=
"some-content" xmlns=
"http://www.w3.org/1999/xhtml">
7 <p id=
"description"></p>
8 <table style=
"text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border=
"1" cellpadding=
"2" cellspacing=
"1">
11 <td style=
"vertical-align: top; text-align: center;"></td>
12 <td style=
"vertical-align: top; text-align: center;"><a id=
"2" href=
"a">2</a></td>
13 <td style=
"vertical-align: top; text-align: center;"></td>
16 <td style=
"vertical-align: top; text-align: center;"><a id=
"4" href=
"a">4</a></td>
17 <td style=
"vertical-align: top; text-align: center;"><input id=
"start" type=
"text" value=
"text"></td>
18 <td style=
"vertical-align: top; text-align: center;"><a id=
"6" href=
"a">6</a></td>
21 <td style=
"vertical-align: top; text-align: center;"></td>
22 <td style=
"vertical-align: top; text-align: center;"><a id=
"8" href=
"a">8</a></td>
23 <td style=
"vertical-align: top; text-align: center;"></td>
27 <div id=
"console"></div>
28 <script type=
"application/javascript">
29 description('This test ensures the correctness of Spatial Navigation (SNav) algorithm over input box.
<br>\
30 * Pre-conditions:
<br>\
31 1) DRT support for SNav enable/disable.
<br>\
32 * Navigation steps:
<br>\
33 1) Loads this page, focus goes to
"start" automatically.
<br>\
34 2) Focus moves away from input box in
4 different directions to neighbor nodes and back.
<br>');
52 if (window.testRunner) {
53 testRunner.dumpAsText();
54 testRunner.overridePreference(
"WebKitTabToLinksPreferenceKey",
1);
55 window.internals.settings.setSpatialNavigationEnabled(true);
56 testRunner.waitUntilDone();
61 // starting the test itself: get to a known place.
62 document.getElementById(
"start").focus();
64 initTest(resultMap, testCompleted);
67 function testCompleted()
69 if (!window.testRunner)
72 var text = 'A text containing a space';
73 for (var i =
0; i < text.length; ++i)
74 eventSender.keyDown(text.charAt(i));
75 shouldBeEqualToString(
"document.getElementById('start').value", text);
77 testRunner.notifyDone();
80 window.onload = runTest;