Commit 59df4e9c authored by JunHo Seo's avatar JunHo Seo Committed by Commit Bot

Revert "Snav: Convert some legacy js-tests to testharness - 2"

This reverts commit cf158e84.

Reason for revert: A converted test snav-media-elements.html becomes flaky

Original change's description:
> Snav: Convert some legacy js-tests to testharness - 2
> 
> Convert list:
> snav-display-contents-crash
> snav-div-in-anchor
> snav-fully-aligned-horizontally
> snav-fully-aligned-vertically
> snav-hidden-focusable-element
> snav-imagemap-area-not-focusable
> snav-imagemap-area-without-image
> snav-imagemap-overlapped-areas
> snav-imagemap-simple
> snav-media-elements
> 
> Bug: 803086
> 
> Change-Id: Iebe20bba5868fec1e1c38f2a188346432c42d568
> Reviewed-on: https://chromium-review.googlesource.com/1184945
> Reviewed-by: Hugo Holgersson <hugoh@vewd.com>
> Commit-Queue: JunHo Seo <junho0924.seo@lge.com>
> Cr-Commit-Position: refs/heads/master@{#585694}

TBR=kochi@chromium.org,szager@chromium.org,junho0924.seo@lge.com,hugoh@vewd.com

Change-Id: Id2448339f31a707ed9f6c769cd71dec0d500d11c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 803086
Reviewed-on: https://chromium-review.googlesource.com/1188262Reviewed-by: default avatarHugo Holgersson <hugoh@vewd.com>
Commit-Queue: JunHo Seo <junho0924.seo@lge.com>
Cr-Commit-Position: refs/heads/master@{#585774}
parent f55d1c53
<div style="display: contents"><a href="#"></a></div> <div style="display: contents"><a href="#"></a></div>
Shouldn't crash. Shouldn't crash.
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script> <script>
test(() => { testRunner.dumpAsText();
assert_true(!!window.testRunner); testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1); testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
eventSender.keyDown("ArrowLeft"); function runTest() {
}, "No crash or assertion failure"); eventSender.keyDown("ArrowLeft");
}
window.onload = runTest;
</script> </script>
DivInLinkA
DivInLinkB
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "e1"
This test is testing that we can navigate on links with divs inside.
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script type="application/javascript">
var resultMap = [
["Down", "e1"],
["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>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml" style="padding:20px">
<a href="#" id="start"><div>DivInLinkA</div></a> <a href="#" id="start"><div>DivInLinkA</div></a>
<a href="#" id="e1"><div>DivInLinkB</div></a> <a href="#" id="e1"><div>DivInLinkB</div></a>
<script src="../../resources/testharness.js"></script> <div id="console"></div>
<script src="../../resources/testharnessreport.js"></script> This test is testing that we can navigate on links with divs inside.
<script src="resources/snav-testharness.js"></script> </body>
<script> </html>
var resultMap = [
["Down", "e1"],
];
// Start at a known place.
document.getElementById("start").focus();
snav.assertFocusMoves(resultMap);
</script>
test
H                               ow Now Brown Cow
Ho                                w Now Brown Cow
How                                 Now Brown Cow
How N                                ow Brown Cow
How No                                w Brown Cow
How Now                                 Brown Cow
How Now B                                rown Cow
How Now Br                                own Cow
How Now Bro                                wn Cow
How Now Brow                                n Cow
How Now Brown                                 Cow
How Now Brown C                                ow
How Now Brown Co                                w
How Now Brown Cow
test
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
PASS gFocusedDocument.activeElement.getAttribute("id") is "6"
PASS gFocusedDocument.activeElement.getAttribute("id") is "8"
PASS gFocusedDocument.activeElement.getAttribute("id") is "7"
PASS gFocusedDocument.activeElement.getAttribute("id") is "9"
PASS gFocusedDocument.activeElement.getAttribute("id") is "10"
PASS gFocusedDocument.activeElement.getAttribute("id") is "12"
PASS gFocusedDocument.activeElement.getAttribute("id") is "11"
PASS gFocusedDocument.activeElement.getAttribute("id") is "13"
PASS gFocusedDocument.activeElement.getAttribute("id") is "14"
PASS gFocusedDocument.activeElement.getAttribute("id") is "16"
PASS gFocusedDocument.activeElement.getAttribute("id") is "15"
PASS gFocusedDocument.activeElement.getAttribute("id") is "17"
PASS gFocusedDocument.activeElement.getAttribute("id") is "18"
PASS gFocusedDocument.activeElement.getAttribute("id") is "20"
PASS gFocusedDocument.activeElement.getAttribute("id") is "19"
PASS gFocusedDocument.activeElement.getAttribute("id") is "21"
PASS gFocusedDocument.activeElement.getAttribute("id") is "22"
PASS gFocusedDocument.activeElement.getAttribute("id") is "24"
PASS gFocusedDocument.activeElement.getAttribute("id") is "23"
PASS gFocusedDocument.activeElement.getAttribute("id") is "25"
PASS gFocusedDocument.activeElement.getAttribute("id") is "26"
PASS gFocusedDocument.activeElement.getAttribute("id") is "27"
PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
<a id="start" href="a">test<br></a> <html>
<a id="1" href="a">H</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<a id="2" href="p">ow Now Brown Cow</a><br> <!--
<a id="3" href="a">Ho</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <a id="4" href="p">w Now Brown Cow</a><br> This test ensures the correctness of the "Fully aligned" precedence
<a id="5" href="a">How</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a id="6" href="p">Now Brown Cow</a><br> logic implemented by Spatial Navigation algorithm in an horizontal direction:
<a id="7" href="a">How N</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <a id="8" href="p">ow Brown Cow</a><br> targets whose middle falls between the top and bottom of the current focused
<a id="9" href="a">How No</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="10" href="p">w Brown Cow</a><br> element are preferably to move focus to, even if it is not the shortest distance.
<a id="11" href="a">How Now </a>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="12" href="p">Brown Cow</a><br>
<a id="13" href="a">How Now B</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="14" href="p">rown Cow</a><br> * Pre-conditions:
<a id="15" href="a">How Now Br</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="16" href="p">own Cow</a><br> 1) DRT support for SNav enable/disable.
<a id="17" href="a">How Now Bro</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="18" href="p">wn Cow</a><br>
<a id="19" href="a">How Now Brow</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a id="20" href="p">n Cow</a><br> * Navigation steps:
<a id="21" href="a">How Now Brown</a> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; <a id="22" href="p">Cow</a><br> 1) Loads this page, focus goes to "start" automatically.
<a id="23" href="a">How Now Brown C</a> &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="24" href="p">ow</a><br> 2) Focus moves preferably to elements right up or above the
<a id="25" href="a">How Now Brown Co</a> &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="26" href="p">w</a><br> current focused element, even when there are some other closer
<a id="27" href="a">How Now Brown Cow</a><br><br> but not vertically aligned elements in the same direction.
<a id="end" href="a">test<br></a> -->
<head>
<p>This test ensures the correctness of the "Fully aligned" precedence logic implemented by Spatial Navigation algorithm in an horizontal direction: targets whose middle falls between the top and bottom of the current focused element are preferably to move focus to, even if it is not the shortest distance.</p> <script src="../../resources/js-test.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script src="../../resources/testharness.js"></script> <script type="application/javascript">
<script src="../../resources/testharnessreport.js"></script>
<script src="resources/snav-testharness.js"></script> var resultMap = [
<script> ["Down", "1"],
var resultMap = [ ["Right", "2"],
["Down", "1"], ["Down", "4"],
["Right", "2"], ["Left", "3"],
["Down", "4"], ["Down", "5"],
["Left", "3"], ["Right", "6"],
["Down", "5"], ["Down", "8"],
["Right", "6"], ["Left", "7"],
["Down", "8"], ["Down", "9"],
["Left", "7"], ["Right", "10"],
["Down", "9"], ["Down", "12"],
["Right", "10"], ["Left", "11"],
["Down", "12"], ["Down", "13"],
["Left", "11"], ["Right", "14"],
["Down", "13"], ["Down", "16"],
["Right", "14"], ["Left", "15"],
["Down", "16"], ["Down", "17"],
["Left", "15"], ["Right", "18"],
["Down", "17"], ["Down", "20"],
["Right", "18"], ["Left", "19"],
["Down", "20"], ["Down", "21"],
["Left", "19"], ["Right", "22"],
["Down", "21"], ["Down", "24"],
["Right", "22"], ["Left", "23"],
["Down", "24"], ["Down", "25"],
["Left", "23"], ["Right", "26"],
["Down", "25"], ["Down", "27"],
["Right", "26"], ["Down", "end"],
["Down", "27"], ["DONE", "DONE"]
["Down", "end"], ];
];
if (window.testRunner) {
// Start at a known place. testRunner.dumpAsText();
document.getElementById("start").focus(); testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
snav.assertFocusMoves(resultMap); testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
</script> 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>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<a id="start" href="a">test<br></a>
<a id="1" href="a">H</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<a id="2" href="p">ow Now Brown Cow</a><br>
<a id="3" href="a">Ho</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <a id="4" href="p">w Now Brown Cow</a><br>
<a id="5" href="a">How</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a id="6" href="p">Now Brown Cow</a><br>
<a id="7" href="a">How N</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <a id="8" href="p">ow Brown Cow</a><br>
<a id="9" href="a">How No</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="10" href="p">w Brown Cow</a><br>
<a id="11" href="a">How Now </a>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="12" href="p">Brown Cow</a><br>
<a id="13" href="a">How Now B</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="14" href="p">rown Cow</a><br>
<a id="15" href="a">How Now Br</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="16" href="p">own Cow</a><br>
<a id="17" href="a">How Now Bro</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="18" href="p">wn Cow</a><br>
<a id="19" href="a">How Now Brow</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a id="20" href="p">n Cow</a><br>
<a id="21" href="a">How Now Brown</a> &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; <a id="22" href="p">Cow</a><br>
<a id="23" href="a">How Now Brown C</a> &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="24" href="p">ow</a><br>
<a id="25" href="a">How Now Brown Co</a> &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <a id="26" href="p">w</a><br>
<a id="27" href="a">How Now Brown Cow</a><br><br>
<a id="end" href="a">test<br></a>
<div id="console"></div>
</body>
</html>
test
test             test
test
test
test
test
test
test
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "6"
PASS gFocusedDocument.activeElement.getAttribute("id") is "7"
PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
PASS gFocusedDocument.activeElement.getAttribute("id") is "8"
PASS gFocusedDocument.activeElement.getAttribute("id") is "6"
<div style="margin-left: 40px; text-align: left;"> <html>
<div style="margin-left: 40px;"> <!--
<a id="start" href="a">test<br></a> This test ensures the correctness of the "Fully aligned" precedence
</div> logic implemented by Spatial Navigation algorithm in an vertical direction:
<a id="2" href="a">test</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a id="3" href="a">test</a><br> targets whose middle falls between the top and bottom of the current focused
<div style="margin-left: 40px;"> element are preferably to move focus to, even if it is not the shortest distance.
<a id="4" href="a">test<br></a>
</div> * Pre-conditions:
<div style="margin-left: 80px;"> 1) DRT support for SNav enable/disable.
<a id="5" href="a">test<br></a>
</div> * Navigation steps:
<div style="margin-left: 40px;"> 1) Loads this page, focus goes to "start" automatically.
<a id="6" href="a">test<br></a> 2) Focus moves preferably to elements right up or above the
</div> current focused element, even when there are some other closer
<a id="7" href="a">test<br></a> but not vertically aligned elements in the same direction.
<br><br><br><br> -->
<div style="margin-left: 40px;"> <head>
<a id="8" href="a">test<br></a> <script src="../../resources/js-test.js"></script>
</div> <script src="resources/spatial-navigation-utils.js"></script>
<a id="end" href="a">test<br></a> <script type="application/javascript">
</div>
var resultMap = [
<p>This test ensures the correctness of the "Fully aligned" precedence logic implemented by Spatial Navigation algorithm in an vertical direction: targets whose middle falls between the top and bottom of the current focused element are preferably to move focus to, even if it is not the shortest distance.</p> ["Down", "4"],
["Down", "6"],
<script src="../../resources/testharness.js"></script> ["Down", "7"],
<script src="../../resources/testharnessreport.js"></script> ["Down", "end"],
<script src="resources/snav-testharness.js"></script> ["Up", "8"],
<script> ["Up", "6"],
var resultMap = [ ["DONE", "DONE"]
["Down", "4"], ];
["Down", "6"],
["Down", "7"], if (window.testRunner) {
["Down", "end"], testRunner.dumpAsText();
["Up", "8"], testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
["Up", "6"], testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
]; testRunner.waitUntilDone();
}
// Start at a known place.
document.getElementById("start").focus(); function runTest()
snav.assertFocusMoves(resultMap); {
</script> // 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>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<div style="margin-left: 40px; text-align: left;">
<div style="margin-left: 40px;">
<a id="start" href="a">test<br></a>
</div>
<a id="2" href="a">test</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a id="3" href="a">test</a><br>
<div style="margin-left: 40px;">
<a id="4" href="a">test<br></a>
</div>
<div style="margin-left: 80px;">
<a id="5" href="a">test<br></a>
</div>
<div style="margin-left: 40px;">
<a id="6" href="a">test<br></a>
</div>
<a id="7" href="a">test<br></a>
<br><br><br><br>
<div style="margin-left: 40px;">
<a id="8" href="a">test<br></a>
</div>
<a id="end" href="a">test<br></a>
</div>
<div id="console"></div>
</body>
</html>
This is link_1.
This is hidden link.
This is link_2.
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
This test is to test that focusable elements with display:none do not grab the focus.
<p>This is <a id="start" href="a">link_1</a>.</p> <html>
<br>This is <a id="1" style="display:none;" href="a">you should not see me</a> hidden link.<br> <head>
<p>This is <a id="end" href="a">link_2</a>.</p> <script src="../../resources/js-test.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<script src="../../resources/testharness.js"></script> <script type="application/javascript">
<script src="../../resources/testharnessreport.js"></script>
<script src="resources/snav-testharness.js"></script> var resultMap = [
<script> ["Down", "end"],
var resultMap = [ ["DONE", "DONE"]
["Down", "end"], ];
];
if (window.testRunner) {
// Start at a known place. testRunner.dumpAsText();
document.getElementById("start").focus(); testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
snav.assertFocusMoves(resultMap); testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
</script> 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>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<p>This is <a id="start" href="a">link_1</a>.</p>
<br>This is <a id="1" style="display:none;" href="a">you should not see me</a> hidden link.<br>
<p>This is <a id="end" href="a">link_2</a>.</p>
<div id="console"></div>
<p>This test is to test that focusable elements with display:none do not grab the focus.</p>
</body>
</html>
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
This test tests that areas of an imagemap without an href are not focusable, thus can not be reached with spatial navigation.
<map name="map" title="map" id="firstmap"> <html>
<area shape="rect" coords="20,20,70,70" href="#" id="1"> <head>
<area shape="rect" coords="20,130,70,180" id="2">
</map> <script src="../../resources/js-test.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<a id="start" href="a"><img src="resources/green.png" width=50px height=50px></a> <script type="application/javascript">
<div>
<img src="resources/green.png" width=200px height=200px usemap="#map"><a id="6" href="a"><img src="resources/green.png" width=50px height=50px></a> var resultMap = [
</div> ["Down", "1"],
<a id="3" href="a"><img src="resources/green.png" width=50px height=50px></a> ["Down", "3"],
["Up", "1"],
<p>This test tests that areas of an imagemap without an href are not focusable, thus can not be reached with spatial navigation.</p> ["Up", "start"],
["DONE", "DONE"]
<script src="../../resources/testharness.js"></script> ];
<script src="../../resources/testharnessreport.js"></script>
<script src="resources/snav-testharness.js"></script> if (window.testRunner) {
<script> testRunner.dumpAsText();
var resultMap = [ testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
["Down", "1"], testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
["Down", "3"], testRunner.waitUntilDone();
["Up", "1"], }
["Up", "start"],
]; function runTest()
{
// Start at a known place. // starting the test itself: get to a known place.
document.getElementById("start").focus(); document.getElementById("start").focus();
snav.assertFocusMoves(resultMap);
</script> initTest(resultMap, testCompleted);
}
function testCompleted()
{
if (window.testRunner)
testRunner.notifyDone();
}
window.onload = runTest;
</script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<map name="map" title="map" id="firstmap">
<area shape="rect" coords="20,20,70,70" href="#" id="1">
<area shape="rect" coords="20,130,70,180" id="2">
</map>
<a id="start" href="a"><img src="resources/green.png" width=50px height=50px></a>
<div>
<img src="resources/green.png" width=200px height=200px usemap="#map"><a id="6" href="a"><img src="resources/green.png" width=50px height=50px></a>
</div>
<a id="3" href="a"><img src="resources/green.png" width=50px height=50px></a>
<div id="console"></div>
<div>This test tests that areas of an imagemap without an href are not focusable, thus can not be reached with spatial navigation.</div>
</body>
</html>
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
This test tests that areas of an imagemap without an image using it, are not focusable, thus can not be reached with spatial navigation.
<map name="map" title="map" id="firstmap"> <html>
<area shape="rect" coords="20,20,70,70" href="#" id="1"> <head>
<area shape="rect" coords="20,130,70,180" href="#" id="2">
</map> <script src="../../resources/js-test.js"></script>
<script src="resources/spatial-navigation-utils.js"></script>
<a id="start" href="a"><img src="resources/green.png" width=50px height=50px></a> <script type="application/javascript">
<div>
<img src="resources/green.png" width=200px height=200px usemap="#othermap"><a id="6" href="a"><img src="resources/green.png" width=50px height=50px></a> var resultMap = [
</div> ["Down", "3"],
<a id="3" href="a"><img src="resources/green.png" width=50px height=50px></a> ["Up", "start"],
["DONE", "DONE"]
<p>This test tests that areas of an imagemap without an image using it, are not focusable, thus can not be reached with spatial navigation.</p> ];
<script src="../../resources/testharness.js"></script> if (window.testRunner) {
<script src="../../resources/testharnessreport.js"></script> testRunner.dumpAsText();
<script src="resources/snav-testharness.js"></script> testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
<script> testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
var resultMap = [ testRunner.waitUntilDone();
["Down", "3"], }
["Up", "start"],
]; function runTest()
{
// Start at a known place. // starting the test itself: get to a known place.
document.getElementById("start").focus(); document.getElementById("start").focus();
snav.assertFocusMoves(resultMap);
</script> initTest(resultMap, testCompleted);
}
function testCompleted()
{
if (window.testRunner)
testRunner.notifyDone();
}
window.onload = runTest;
</script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<map name="map" title="map" id="firstmap">
<area shape="rect" coords="20,20,70,70" href="#" id="1">
<area shape="rect" coords="20,130,70,180" href="#" id="2">
</map>
<a id="start" href="a"><img src="resources/green.png" width=50px height=50px></a>
<div>
<img src="resources/green.png" width=200px height=200px usemap="#othermap"><a id="6" href="a"><img src="resources/green.png" width=50px height=50px></a>
</div>
<a id="3" href="a"><img src="resources/green.png" width=50px height=50px></a>
<div id="console"></div>
<div>This test tests that areas of an imagemap without an image using it, are not focusable, thus can not be reached with spatial navigation.</div>
</body>
</html>
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
This test tests that areas of an imagemap can be reached with spatial navigation even if they are overlapped.
<map name="map" title="map" id="firstmap"> <html>
<area shape="circle" coords="45,45,25" href="#" id="1"> <head>
<area shape="rect" coords="45,60,95,110" href="#" id="2">
<area shape="poly" coords="80,20,130,20,130,180,30,180,30,130,80,130" href="#" id="3"> <script src="../../resources/js-test.js"></script>
<area shape="default" href="#" id="4"> <script src="resources/spatial-navigation-utils.js"></script>
</map> <script type="application/javascript">
<a id="start" href="a"><img src="resources/green.png" width=50px height=50px></a> var resultMap = [
<div> ["Down", "4"],
<img src="resources/green.png" width=200px height=200px usemap="#map"> ["Down", "1"],
</div> ["Down", "2"],
<a id="5" href="a"><img src="resources/green.png" width=50px height=50px></a> ["Down", "5"],
["Up", "4"],
<p>This test tests that areas of an imagemap can be reached with spatial navigation even if they are overlapped.</p> ["Up", "3"],
["Up", "2"],
<script src="../../resources/testharness.js"></script> ["Left", "1"],
<script src="../../resources/testharnessreport.js"></script> ["Right", "3"],
<script src="resources/snav-testharness.js"></script> ["Left", "2"],
<script> ["Up", "1"],
var resultMap = [ ["Up", "start"],
["Down", "4"], ["DONE", "DONE"]
["Down", "1"], ];
["Down", "2"],
["Down", "5"], if (window.testRunner) {
["Up", "4"], testRunner.dumpAsText();
["Up", "3"], testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
["Up", "2"], testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
["Left", "1"], testRunner.waitUntilDone();
["Right", "3"], }
["Left", "2"],
["Up", "1"], function runTest()
["Up", "start"], {
]; // starting the test itself: get to a known place.
document.getElementById("start").focus();
// Start at a known place.
document.getElementById("start").focus(); initTest(resultMap, testCompleted);
snav.assertFocusMoves(resultMap); }
</script>
function testCompleted()
{
if (window.testRunner)
testRunner.notifyDone();
}
window.onload = runTest;
</script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<map name="map" title="map" id="firstmap">
<area shape="circle" coords="45,45,25" href="#" id="1">
<area shape="rect" coords="45,60,95,110" href="#" id="2">
<area shape="poly" coords="80,20,130,20,130,180,30,180,30,130,80,130" href="#" id="3">
<area shape="default" href="#" id="4">
</map>
<a id="start" href="a"><img src="resources/green.png" width=50px height=50px></a>
<div>
<img src="resources/green.png" width=200px height=200px usemap="#map">
</div>
<a id="5" href="a"><img src="resources/green.png" width=50px height=50px></a>
<div id="console"></div>
<div>This test tests that areas of an imagemap can be reached with spatial navigation even if they are overlapped.</div>
</body>
</html>
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "6"
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
This test tests that areas of an imagemap can be reached with spatial navigation.
<map name="map" title="map" id="firstmap"> <html>
<area shape="rect" coords="20,20,70,70" href="#" id="1"> <head>
<area shape="rect" coords="130,20,180,70" href="#" id="2">
<area shape="rect" coords="20,130,70,180" href="#" id="3"> <script src="../../resources/js-test.js"></script>
<area shape="rect" coords="130,130,180,180" href="#" id="4"> <script src="resources/spatial-navigation-utils.js"></script>
</map> <script type="application/javascript">
<a id="start" href="a"><img src="resources/green.png" width=50px height=50px></a> var resultMap = [
<div> ["Down", "1"],
<img src="resources/green.png" width=200px height=200px usemap="#map"><a id="6" href="a"><img src="resources/green.png" width=50px height=50px></a> ["Down", "3"],
</div> ["Down", "5"],
<a id="5" href="a"><img src="resources/green.png" width=50px height=50px></a> ["Up", "3"],
["Right", "4"],
<p>This test tests that areas of an imagemap can be reached with spatial navigation.</p> ["Right", "6"],
["Left", "4"],
<script src="../../resources/testharness.js"></script> ["Up", "2"],
<script src="../../resources/testharnessreport.js"></script> ["Left", "1"],
<script src="resources/snav-testharness.js"></script> ["Up", "start"],
<script> ["DONE", "DONE"]
var resultMap = [ ];
["Down", "1"],
["Down", "3"], if (window.testRunner) {
["Down", "5"], testRunner.dumpAsText();
["Up", "3"], testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
["Right", "4"], testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
["Right", "6"], testRunner.waitUntilDone();
["Left", "4"], }
["Up", "2"],
["Left", "1"], function runTest()
["Up", "start"], {
]; // starting the test itself: get to a known place.
document.getElementById("start").focus();
// Start at a known place.
document.getElementById("start").focus(); initTest(resultMap, testCompleted);
snav.assertFocusMoves(resultMap); }
</script>
function testCompleted()
{
if (window.testRunner)
testRunner.notifyDone();
}
window.onload = runTest;
</script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<map name="map" title="map" id="firstmap">
<area shape="rect" coords="20,20,70,70" href="#" id="1">
<area shape="rect" coords="130,20,180,70" href="#" id="2">
<area shape="rect" coords="20,130,70,180" href="#" id="3">
<area shape="rect" coords="130,130,180,180" href="#" id="4">
</map>
<a id="start" href="a"><img src="resources/green.png" width=50px height=50px></a>
<div>
<img src="resources/green.png" width=200px height=200px usemap="#map"><a id="6" href="a"><img src="resources/green.png" width=50px height=50px></a>
</div>
<a id="5" href="a"><img src="resources/green.png" width=50px height=50px></a>
<div id="console"></div>
<div>This test tests that areas of an imagemap can be reached with spatial navigation.</div>
</body>
</html>
This is a link start of Test.
This is a link i2.
This is a link i4.
This is a link i6.
This is a link i8.
This is a link End of Test.
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
PASS gFocusedDocument.activeElement.getAttribute("id") is "v1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "i2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "v3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "i4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "v5"
PASS gFocusedDocument.activeElement.getAttribute("id") is "i6"
PASS gFocusedDocument.activeElement.getAttribute("id") is "a7"
PASS gFocusedDocument.activeElement.getAttribute("id") is "i8"
PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
PASS gFocusedDocument.activeElement.getAttribute("id") is "i8"
PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
PASS successfullyParsed is true
TEST COMPLETE
This tests that a media elements ie: <Audio> or <video>, without tabindex are able to be reached through keyboard access
<p>This is a link <a id="start" href="a">start of Test</a>.</p> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<video id="v1" controls tabindex="0" src="../../media/content/test.mp4"></video> <html>
<p>This is a link <a id="i2" href="a">i2</a>.</p> <head>
<video id="v3" controls src="../../media/content/test.mp4"></video> <script src="../../resources/js-test.js"></script>
<p>This is a link <a id="i4" href="a">i4</a>.</p> <script src="resources/spatial-navigation-utils.js"></script>
<video id="v5" tabindex="0" src="../../media/content/test.mp4"></video> <script type="application/javascript">
<p>This is a link <a id="i6" href="a">i6</a>.</p>
<audio id="a7" controls src="../../media/content/test.wav"></audio> var resultMap = [
<p>This is a link <a id="i8" href="a">i8</a>.</p> ["Up", "start"],
<!-- 'a9' is not focussable: no controls attribute as well no tab index. ["Down", "v1"],
Key down from 'i8' should go to 'end'. --> ["Down", "i2"],
<audio id="a9" src="../../media/content/test.mp4"></audio> ["Down", "v3"],
<p>This is a link <a id="end" href="a">End of Test</a>.</p> ["Down", "i4"],
["Down", "v5"],
<p>This tests that a media elements ie: <code>&lt;Audio&gt;</code> or <code>&lt;video&gt;</code>, without tabindex are able to be reached through keyboard access</p> ["Down", "i6"],
["Down", "a7"],
<script src="../../resources/testharness.js"></script> ["Down", "i8"],
<script src="../../resources/testharnessreport.js"></script> ["Down", "end"],
<script src="resources/snav-testharness.js"></script> ["Up", "i8"],
<script> ["Down", "end"],
var resultMap = [ ["DONE", "DONE"]
["Up", "start"], ];
["Down", "v1"],
["Down", "i2"], if (window.testRunner) {
["Down", "v3"], testRunner.dumpAsText();
["Down", "i4"], testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
["Down", "v5"], testRunner.overridePreference("WebKitSpatialNavigationEnabled", 1);
["Down", "i6"], }
["Down", "a7"],
["Down", "i8"], function runTest()
["Down", "end"], {
["Up", "i8"], // starting the test itself: get to a known place.
["Down", "end"], document.getElementById("start").focus();
];
initTest(resultMap, testCompleted);
// Start at a known place. }
document.getElementById("start").focus();
snav.assertFocusMoves(resultMap); function testCompleted()
</script> {
finishJSTest();
}
window.onload = runTest;
jsTestIsAsync = true;
</script>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
<p>This is a link <a id="start" href="a">start of Test</a>.</p>
<video id="v1" controls tabindex="0" src="../../media/content/test.mp4"></video>
<p>This is a link <a id="i2" href="a">i2</a>.</p>
<video id="v3" controls src="../../media/content/test.mp4"></video>
<p>This is a link <a id="i4" href="a">i4</a>.</p>
<video id="v5" tabindex="0" src="../../media/content/test.mp4"></video>
<p>This is a link <a id="i6" href="a">i6</a>.</p>
<audio id="a7" controls src="../../media/content/test.wav"></audio>
<p>This is a link <a id="i8" href="a">i8</a>.</p>
<!-- 'a9' is not focussable: no controls attribute as well no tab index.
Key down from 'i8' should go to 'end'. -->
<audio id="a9" src="../../media/content/test.mp4"></audio>
<p>This is a link <a id="end" href="a">End of Test</a>.</p>
<div id="console"></div>
<p>This tests that a media elements ie: <code>&lt;Audio&gt;</code> or <code>&lt;video&gt;</code>, without tabindex are able to be reached through keyboard access</p>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment