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;"><textarea id=
"start" rows=
"5" cols=
"2">abc d
</textarea>
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 textarea.
<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 textarea in
4 different directions to neighbor nodes and back.
<br>');
55 if (window.testRunner) {
56 testRunner.dumpAsText();
57 testRunner.overridePreference(
"WebKitTabToLinksPreferenceKey",
1);
58 window.internals.settings.setSpatialNavigationEnabled(true);
59 testRunner.waitUntilDone();
64 var textarea = document.getElementById(
"start");
65 textarea.value =
"abc\nd";
67 // starting the test itself: get to a known place.
69 textarea.setSelectionRange(
0,
0);
71 initTest(resultMap, testCompleted);
74 function testCompleted()
76 if (!window.testRunner)
79 document.getElementById('start').value =
"";
80 var text = 'A text containing a space\nand a new line';
81 for (var i =
0; i < text.length; ++i)
82 eventSender.keyDown(text.charAt(i));
83 shouldBeEqualToString(
"document.getElementById('start').value", text);
85 testRunner.notifyDone();
88 window.onload = runTest;