blob: bb511d25d16ad42db7f23297fdded9437c2f4b53 [file] [log] [blame]
<!--
This test ensures the correctness of a basic aspect of spatial navigation's
search for candidates to focus: an iframe element without any focusable content
should be ignored.
* Pre-conditions:
1) Run chromium with --enable-spatial-navigation.
* Navigation steps:
1) Loads this page, focus goes to "start" automatically.
2) Focus moves from "start" to "end" and return back.
-->
<script src="../../resources/js-test.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Down", "end"],
["Up", "start"],
["Left", "end"],
["Right", "start"],
["DONE", "DONE"]
];
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
testRunner.waitUntilDone();
}
function runTest()
{
// starting the test itself: get to a known place.
document.getElementById("start").focus();
initTest(resultMap, testCompleted);
}
function testCompleted()
{
if (window.testRunner)
testRunner.notifyDone();
}
window.onload = runTest;
</script>
<div style="position: relative;">
<a id="start" href="#" style="position: absolute; top: 10px; left: 50px;">Start</a>
<a id="end" href="#" style="position: absolute; top: 50px; left: 10px;">End</a>
<iframe style="position: absolute; top: 50px; left: 50px;" src="data:text/html,"></iframe>
</div>
<div id="console"></div>
<div>This test tests that an iframe element without any focusable content will be ignored.</div>