Chromium Code Reviews| Index: LayoutTests/fast/spatial-navigation/snav-overlapping-elements.html |
| diff --git a/LayoutTests/fast/spatial-navigation/snav-overlapping-elements.html b/LayoutTests/fast/spatial-navigation/snav-overlapping-elements.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5e68057daf5cb7416959a9a16de738f938a5afbf |
| --- /dev/null |
| +++ b/LayoutTests/fast/spatial-navigation/snav-overlapping-elements.html |
| @@ -0,0 +1,94 @@ |
| +<!DOCTYPE html> |
| +<head> |
| +<script src="../../resources/js-test.js"></script> |
| +<script src="resources/spatial-navigation-utils.js"></script> |
| +</head> |
| +<style> |
| + 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.
|
| + position: absolute; |
| + height: 100px; |
| + width: 100px; |
| + border: 1px solid black; |
| + } |
| + #e1 { |
| + left: 10px; |
| + top: 10px; |
| + } |
| + #e2 { |
| + left: 20px; |
| + top: 75px; |
| + } |
| + #e3 { |
| + left: 10px; |
| + top: 150px; |
| + } |
| + #e4 { |
| + left: 10px; |
| + top: 300px; |
| + } |
| + #e5 { |
| + left: 75px; |
| + top: 300px; |
| + } |
| + #e6 { |
| + left: 150px; |
| + top: 300px; |
| + } |
| +</style> |
| +<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.
|
| +<p id="description"></p> |
| +<div id="elements"> |
| +<!-- Vertical: --> |
| +<a id="e1" href="#e1">Element 1</a> |
| +<a id="e2" href="#e2">Element 2</a> |
| +<a id="e3" href="#e3">Element 3</a> |
| +<!-- Horizontal: --> |
| +<a id="e4" href="#e1">Element 4</a> |
| +<a id="e5" href="#e2">Element 5</a> |
| +<a id="e6" href="#e3">Element 6</a> |
| +</div> |
| +<div id="console"></div> |
| +<script type="application/javascript"> |
| +description('This test ensures that Spatial Navigation works with overlapping elements.<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.
|
| + * Pre-conditions:<br>\ |
| + 1) Spatial navigation enabled.<br>\ |
| + * Navigation steps:<br>\ |
| + 1) Loads this page, focus goes to start position (element #e5) automatically.<br>\ |
| + 2) Focus moves away from start postion in various direction, CSS nav-* attributes are expected to be respected.<br>'); |
| + |
| +jsTestIsAsync = true; |
| + |
| +var resultMap = [ |
| + // Vertical: |
| + ["Down", "e2"], |
| + ["Down", "e3"], |
| + ["Up", "e2"], |
| + ["Up", "e1"], |
| + ["Down", "e2"], |
| + ["Down", "e3"], |
| + ["Down", "e4"], |
| + // Horizontal: |
| + ["Right", "e5"], |
| + ["Right", "e6"], |
| + ["Left", "e5"], |
| + ["Left", "e4"], |
| + ["DONE", "DONE"] |
| +]; |
| + |
| +if (window.testRunner) { |
| + 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.
|
| + testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1); |
| + window.internals.settings.setSpatialNavigationEnabled(true); |
| + 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.
|
| +} |
| + |
| +function runTest() |
| +{ |
| + // starting the test itself: get to a known place. |
| + document.getElementById("e1").focus(); |
| + |
| + initTest(resultMap, finishJSTest); |
| +} |
| +</script> |
| +</body> |
| +</html> |