Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-radio-group.html
blob140da26cc5f63201aab5162dd61718e1a67a26f9
1 <html>
2 <!--
3 This test ensures the correctness of Spatial Navigation (SNav) algorithm over single select element.
5 * Pre-conditions:
6 1) DRT support for SNav enable/disable.
8 * Navigation steps:
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.
11 -->
12 <head>
13 <script src="../../resources/js-test.js"></script>
14 <script src="resources/spatial-navigation-utils.js"></script>
15 <script type="application/javascript">
17 var resultMap = [
18 ["Down", "down"],
19 ["Down", "8"],
20 ["Up", "down"],
21 ["Up", "start"],
22 ["Up", "up"],
23 ["Up", "2"],
24 ["Down", "up"],
25 ["Down", "start"],
26 ["Right", "right"],
27 ["Right", "6"],
28 ["Left", "right"],
29 ["Left", "start"],
30 ["Left", "left"],
31 ["Left", "4"],
32 ["Right", "left"],
33 ["Right", "start"],
34 ["DONE", "DONE"]
37 if (window.testRunner) {
38 testRunner.dumpAsText();
39 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
40 window.internals.settings.setSpatialNavigationEnabled(true);
41 testRunner.waitUntilDone();
44 function runTest()
46 // starting the test itself: get to a known place.
47 document.getElementById("start").focus();
49 initTest(resultMap, testCompleted);
52 function testCompleted()
54 if (window.testRunner)
55 shouldBe("document.getElementById('down').checked", "true");
56 testRunner.notifyDone();
59 window.onload = runTest;
61 </script>
62 </head>
63 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
64 <table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1">
65 <tbody>
66 <tr>
67 <td style="vertical-align: center; text-align: center;"></td>
68 <td style="vertical-align: center; text-align: center;"><a id="2" href="a">2</a></td>
69 <td style="vertical-align: center; text-align: center;"></td>
70 </tr>
71 <tr>
72 <td style="vertical-align: center; text-align: center;"><a id="4" href="a">4</a></td>
73 <td style="vertical-align: center; text-align: center;">
74 <table style="text-align: center; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1">
75 <tbody>
76 <tr>
77 <td style="vertical-align: center; text-align: center;"></td>
78 <td style="vertical-align: center; text-align: center;"><input type="radio" name="group" id="up" ></td>
79 <td style="vertical-align: center; text-align: center;"></td>
80 </tr>
81 <tr>
82 <td style="vertical-align: center; text-align: center;"><input type="radio" name="group" id="left" ></td>
83 <td style="vertical-align: center; text-align: center;">
84 <input type="radio" name="group" id="start" >
85 </td>
86 <td style="vertical-align: center; text-align: center;"><input type="radio" name="group" id="right" ></td>
87 </tr>
88 <tr>
89 <td style="vertical-align: center; text-align: center;"></td>
90 <td style="vertical-align: center; text-align: center;"><input type="radio" name="group" id="down" checked ></td>
91 <td style="vertical-align: center; text-align: center;"></td>
92 </tr>
93 </tbody>
94 </table>
95 </td>
96 <td style="vertical-align: center; text-align: center;"><a id="6" href="a">6</a></td>
97 </tr>
98 <tr>
99 <td style="vertical-align: center; text-align: center;"></td>
100 <td style="vertical-align: center; text-align: center;"><a id="8" href="a">8</a></td>
101 <td style="vertical-align: center; text-align: center;"></td>
102 </tr>
103 </tbody>
104 </table>
105 <div id="console"></div>
106 </body>
107 </html>