OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <head> | |
3 <script src="../../resources/js-test.js"></script> | |
4 <script src="resources/spatial-navigation-utils.js"></script> | |
5 </head> | |
6 <style> | |
7 body a { | |
tkent
2013/12/06 01:16:11
nit: You don't need to indent whole content of <st
Krzysztof Olczyk
2014/04/04 11:52:15
Done.
| |
8 position: absolute; | |
9 height: 100px; | |
10 width: 100px; | |
11 border: 1px solid black; | |
12 } | |
13 #e1 { | |
14 left: 10px; | |
15 top: 10px; | |
16 } | |
17 #e2 { | |
18 left: 20px; | |
19 top: 75px; | |
20 } | |
21 #e3 { | |
22 left: 10px; | |
23 top: 150px; | |
24 } | |
25 #e4 { | |
26 left: 10px; | |
27 top: 300px; | |
28 } | |
29 #e5 { | |
30 left: 75px; | |
31 top: 300px; | |
32 } | |
33 #e6 { | |
34 left: 150px; | |
35 top: 300px; | |
36 } | |
37 </style> | |
38 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml" onload="runTest()"> | |
tkent
2013/12/06 01:16:11
nit: xmlns is unnecessary.
Krzysztof Olczyk
2014/04/04 11:52:15
Done.
| |
39 <p id="description"></p> | |
40 <div id="elements"> | |
41 <!-- Vertical: --> | |
42 <a id="e1" href="#e1">Element 1</a> | |
43 <a id="e2" href="#e2">Element 2</a> | |
44 <a id="e3" href="#e3">Element 3</a> | |
45 <!-- Horizontal: --> | |
46 <a id="e4" href="#e1">Element 4</a> | |
47 <a id="e5" href="#e2">Element 5</a> | |
48 <a id="e6" href="#e3">Element 6</a> | |
49 </div> | |
50 <div id="console"></div> | |
51 <script type="application/javascript"> | |
52 description('This test ensures that Spatial Navigation works with overlapping el ements.<br>\ | |
tkent
2013/12/06 01:16:11
I don't recommend to use HTML tags in the argument
Krzysztof Olczyk
2014/04/04 11:52:15
Done.
| |
53 * Pre-conditions:<br>\ | |
54 1) Spatial navigation enabled.<br>\ | |
55 * Navigation steps:<br>\ | |
56 1) Loads this page, focus goes to start position (element #e5) autom atically.<br>\ | |
57 2) Focus moves away from start postion in various direction, CSS nav -* attributes are expected to be respected.<br>'); | |
58 | |
59 jsTestIsAsync = true; | |
60 | |
61 var resultMap = [ | |
62 // Vertical: | |
63 ["Down", "e2"], | |
64 ["Down", "e3"], | |
65 ["Up", "e2"], | |
66 ["Up", "e1"], | |
67 ["Down", "e2"], | |
68 ["Down", "e3"], | |
69 ["Down", "e4"], | |
70 // Horizontal: | |
71 ["Right", "e5"], | |
72 ["Right", "e6"], | |
73 ["Left", "e5"], | |
74 ["Left", "e4"], | |
75 ["DONE", "DONE"] | |
76 ]; | |
77 | |
78 if (window.testRunner) { | |
79 testRunner.dumpAsText(); | |
tkent
2013/12/06 01:16:11
dumpAsText() is unnecessary. js-test.js calls it.
Krzysztof Olczyk
2014/04/04 11:52:15
Done.
| |
80 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1); | |
81 window.internals.settings.setSpatialNavigationEnabled(true); | |
82 testRunner.waitUntilDone(); | |
tkent
2013/12/06 01:16:11
waitUntilDone is unnecessary. js-test-js with jsT
Krzysztof Olczyk
2014/04/04 11:52:15
Done.
| |
83 } | |
84 | |
85 function runTest() | |
86 { | |
87 // starting the test itself: get to a known place. | |
88 document.getElementById("e1").focus(); | |
89 | |
90 initTest(resultMap, finishJSTest); | |
91 } | |
92 </script> | |
93 </body> | |
94 </html> | |
OLD | NEW |