Update web-platform-tests to revision 4a5223502fa660ce03e470af6a61c8bc26c5a8ee

This commit is contained in:
WPT Sync Bot 2018-04-23 21:13:37 -04:00
parent c5f7c9ccf3
commit e891345f26
1328 changed files with 36632 additions and 20588 deletions

View file

@ -7,17 +7,12 @@
<meta assert="assert" content="Check if the key events received by document are targeted at the element when it is focused">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<h2>Steps:</h2>
<ol>
<li>Input any character into the textbox by keyboard in 10 seconds.</li>
</ol>
<h2>Expect results:</h2>
<p>PASS</p>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id="log"></div>
<input id="test">
<script>
//These tests can be automated once we have an uniform way to use webdriver.
var t1 = async_test("The keydown event must be targeted at the input element"),
t2 = async_test("The keypress event must be targeted at the input element"),
t3 = async_test("The keyup event must be targeted at the input element"),
@ -40,4 +35,10 @@ document.onkeyup = t3.step_func_done(function(evt){
assert_equals(evt.target, testEle, "The keyup events must be targeted at the input element.");
});
var input_element = document.getElementById("test");
t1.step(function() {
test_driver.send_keys(input_element, "a");
});
</script>

View file

@ -7,16 +7,11 @@
<meta assert="assert" content="Check if the key events received by document are targeted at the element when no element is focused">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<h2>Steps:</h2>
<ol>
<li>Press any key in [0-9a-zA-Z].</li>
</ol>
<h2>Expect results:</h2>
<p>PASS</p>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id="log"></div>
<script>
//These tests can be automated once we have an uniform way to use webdriver.
var t1 = async_test("The keydown event must be targeted at the body element"),
t2 = async_test("The keypress event must be targeted at the body element"),
t3 = async_test("The keyup event must be targeted at the body element");
@ -35,4 +30,8 @@ document.onkeyup = t3.step_func_done(function(evt){
assert_equals(evt.target, document.body, "The keyup events must be targeted at the document's body.");
});
t1.step(function() {
test_driver.send_keys(document.body, "a");
});
</script>

View file

@ -7,12 +7,8 @@
<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<h2>Steps:</h2>
<ol>
<li>Press 'Tab' key in 10 seconds.</li>
</ol>
<h2>Expect results:</h2>
<p>PASS</p>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id="log"></div>
<form id="fm">
<input id="test1" tabindex="-1">
@ -20,7 +16,6 @@
</form>
<script>
//This test can be automated once we have an uniform way to use webdriver.
var t = async_test("The element with a negative tabindex must not be focused by press 'Tab' key");
setup({timeout: 10000});
@ -41,4 +36,9 @@ document.addEventListener("keydown", function (evt) {
});
}, true);
t.step(function () {
// TAB = '\ue004'
test_driver.send_keys(document.body, "\ue004");
});
</script>

View file

@ -2,17 +2,13 @@
<meta charset="utf-8">
<title>HTML Test: focus - the sequential focus navigation order</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#sequential-focus-navigation-and-the-tabindex-attribute">
<link rel="help" href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation">
<meta assert="flag" content="interact">
<meta assert="assert" content="Check the sequential focus navigation order">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<h2>Steps:</h2>
<ol>
<li>Press 'Tab' key at least 10 times in 20 seconds.(Long press the 'Tab' key will be better.)</li>
</ol>
<h2>Expect results:</h2>
<p>PASS</p>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id="log"></div>
<form id="fm">
<button id="btn0">tabindex(omitted)</button>
@ -28,32 +24,41 @@
</form>
<script>
//This test can be automated once we have an uniform way to use webdriver.
var i = 0,
expectation = ["btn9", "btn6", "btn7", "btn8", "btn5", "btn0", "btn1", "btn2", "btn4"],
results = [],
t = async_test("The element with a zero tabindex must be focused by press 'Tab' key");
t = async_test("Elements with different tabindex must be focused sequentially when pressing 'Tab' keys");
setup(function () {
document.body.focus();
}, {timeout: 20000});
document.forms.fm.addEventListener("focus", function (evt) {
results.push(evt.target.id);
if (i >= 9) {
if (i >= 8) {
t.step(function () {
assert_array_equals(results, expectation);
});
t.done();
} else {
t.step(function () {
// TAB = '\ue004'
test_driver.send_keys(document.body, "\ue004");
});
}
i++;
}, true);
document.addEventListener("keydown", function (evt) {
if (evt.keyCode === 9) {
i += 1;
if (i === 10) {
t.done();
}
}
t.step(function () {
assert_equals(evt.keyCode, 9, "Please press 'Tab' key.");
});
}, true);
t.step(function () {
// TAB = '\ue004'
test_driver.send_keys(document.body, "\ue004");
});
</script>

View file

@ -7,19 +7,14 @@
<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<h2>Steps:</h2>
<ol>
<li>Press 'Tab' key in 10 seconds.</li>
</ol>
<h2>Expect results:</h2>
<p>PASS</p>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id="log"></div>
<form id="fm">
<input id="test" tabindex="1">
</form>
<script>
//This test can be automated once we have an uniform way to use webdriver.
var t = async_test("The element with a positive tabindex must be focused by press 'Tab' key");
setup({timeout: 10000});
@ -40,4 +35,9 @@ document.addEventListener("keydown", function (evt) {
});
}, true);
t.step(function () {
// TAB = '\ue004'
test_driver.send_keys(document.body, "\ue004");
});
</script>

View file

@ -8,20 +8,15 @@
<meta assert="assert" content="Check if the tabindex attribute controls whether an element is supposed to be focusable">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
</head>
<h2>Steps:</h2>
<ol>
<li>Press 'Tab' key in 10 seconds.</li>
</ol>
<h2>Expect results:</h2>
<p>PASS</p>
<div id="log"></div>
<form id="fm">
<input id="test" tabindex="0">
</form>
<script>
//This test can be automated once we have an uniform way to use webdriver.
var t = async_test("The element with a zero tabindex must be focused by press 'Tab' key");
setup({timeout: 10000});
@ -42,4 +37,9 @@ document.addEventListener("keydown", function (evt) {
});
}, true);
t.step(function () {
// TAB = '\ue004'
test_driver.send_keys(document.body, "\ue004");
});
</script>