Commit 07166214 authored by Hugo Holgersson's avatar Hugo Holgersson Committed by Commit Bot

Snav: Convert snav-two-elements-one-line.html to snav-testharness.js

With snav-testharness.js, the flakiness seen in Issue 836275 will
most probably be gone.

Bug: 803086, 836275
Change-Id: If44b1ca5c88af3c0fcc045061cdce50dcc91a276
Reviewed-on: https://chromium-review.googlesource.com/c/1257919Reviewed-by: default avatarFredrik Söderquist <fs@opera.com>
Commit-Queue: Hugo Holgersson <hugoh@vewd.com>
Cr-Commit-Position: refs/heads/master@{#596206}
parent eff4e801
......@@ -4766,7 +4766,6 @@ crbug.com/831796 virtual/mouseevent_fractional/fast/events/autoscroll-in-textfie
# Sheriff 2018-04-24
crbug.com/836242 [ Linux Mac Win ] fast/loader/reload-zero-byte-plugin.html [ Pass Failure ]
crbug.com/836275 [ Linux Mac ] fast/spatial-navigation/snav-two-elements-one-line.html [ Pass Failure ]
# Sheriff 2018-04-25
crbug.com/836783 fast/peerconnection/RTCRtpSender-setParameters.html [ Pass Timeout ]
......
AAAAAAAAAA AAAAAAAAAA AA AA AAAAAAAAAA AAAAAAAAAA
AAAAAAAAAA AAAAAAAAAA AA B AA AAAAAAAAAA AAAAAAAAAA
PASS successfullyParsed is true
TEST COMPLETE
PASS gFocusedDocument.activeElement.getAttribute("id") is "e1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "e2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "e3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "e2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "e1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
This test is testing that we can handle 2 inline elements in the same line.
<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"],
["Down", "e2"],
["Down", "e3"],
["Up", "e2"],
["Up", "e1"],
["Up", "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>
<style>
div.container1 { width: 100px;}
div.container2 { width: 100px;}
</style>
</head>
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml" style="padding:20px">
<div class="container1">
<a href="#" id="start">AAAAAAAAAA AAAAAAAAAA AA</a>
<a href="#" id="e1">AA AAAAAAAAAA AAAAAAAAAA</a>
<!DOCTYPE html>
<style>
div { width: 100px;}
</style>
<div>
<a href="#" id="start">AAAAAAAAAA AAAAAAAAAA AA</a>
<a href="#" id="e1">AA AAAAAAAAAA AAAAAAAAAA</a>
</div>
<br><br>
<div class="container2">
<a href="#" id="e2">AAAAAAAAAA AAAAAAAAAA AA</a>
<span>B</span>
<a href="#" id="e3">AA AAAAAAAAAA AAAAAAAAAA</a>
<div>
<a href="#" id="e2">AAAAAAAAAA AAAAAAAAAA AA</a>
<span>B</span>
<a href="#" id="e3">AA AAAAAAAAAA AAAAAAAAAA</a>
</div>
<div id="console"></div>
This test is testing that we can handle 2 inline elements in the same line.
</body>
</html>
<p>Spatnav can navigate focusables that span multiple lines.</p>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="resources/snav-testharness.js"></script>
<script>
var resultMap = [
["Down", "e1"],
["Down", "e2"],
["Down", "e3"],
["Up", "e2"],
["Up", "e1"],
["Up", "start"],
];
document.getElementById("start").focus();
snav.assertFocusMoves(resultMap);
</script>
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