Git init
[framework/web/webkit-efl.git] / LayoutTests / fast / spatial-navigation / snav-input.html
1 <!DOCTYPE html>
2   <head>
3     <script src="../js/resources/js-test-pre.js"></script>
4     <script src="resources/spatial-navigation-utils.js"></script>
5     <script src="js/resources/js-test-post.js"></script>
6   </head>
7   <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
8     <p id="description"></p>
9     <table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1">
10       <tbody>
11         <tr>
12           <td style="vertical-align: top; text-align: center;"></td>
13           <td style="vertical-align: top; text-align: center;"><a id="2" href="a">2</a></td>
14           <td style="vertical-align: top; text-align: center;"></td>
15         </tr>
16         <tr>
17           <td style="vertical-align: top; text-align: center;"><a id="4" href="a">4</a></td>
18           <td style="vertical-align: top; text-align: center;"><input id="start" type="text" value="text"></td>
19           <td style="vertical-align: top; text-align: center;"><a id="6" href="a">6</a></td>
20         </tr>
21         <tr>
22           <td style="vertical-align: top; text-align: center;"></td>
23           <td style="vertical-align: top; text-align: center;"><a id="8" href="a">8</a></td>
24           <td style="vertical-align: top; text-align: center;"></td>
25         </tr>
26       </tbody>
27     </table>
28     <div id="console"></div>
29     <script type="application/javascript">
30     description('This test ensures the correctness of Spatial Navigation (SNav) algorithm over input box.<br>\
31                 * Pre-conditions:<br>\
32                 1) DRT support for SNav enable/disable.<br>\
33                 * Navigation steps:<br>\
34                 1) Loads this page, focus goes to "start" automatically.<br>\
35                 2) Focus moves away from input box in 4 different directions to neighbor nodes and back.<br>');
36
37     var resultMap = [
38       ["Down", "start"],
39       ["Down", "8"],
40       ["Up", "start"],
41       ["Up", "start"],
42       ["Up", "2"],
43       ["Down", "start"],
44       ["Right", "start"],
45       ["Right", "6"],
46       ["Left", "start"],
47       ["Left", "start"],
48       ["Left", "4"],
49       ["Right", "start"],
50       ["DONE", "DONE"]
51     ];
52
53     if (window.layoutTestController) {
54       layoutTestController.dumpAsText();
55       layoutTestController.setSpatialNavigationEnabled(true);
56       layoutTestController.overridePreference("WebKitTabToLinksPreferenceKey", 1);
57       layoutTestController.waitUntilDone();
58     }
59
60     function runTest()
61     {
62       // starting the test itself: get to a known place.
63       document.getElementById("start").focus();
64
65       initTest(resultMap, testCompleted);
66     }
67
68     function testCompleted()
69     {
70       if (window.layoutTestController)
71         layoutTestController.notifyDone();
72     }
73
74     window.onload = runTest;
75
76     </script>
77   </body>
78 </html>