Update web-platform-tests to revision be5419e845d39089ba6dc338c1bd0fa279108317

This commit is contained in:
Josh Matthews 2018-01-04 13:44:24 -05:00
parent aa199307c8
commit 2b6f573eb5
3440 changed files with 109438 additions and 41750 deletions

View file

@ -10,6 +10,17 @@
<textarea id="b">abcde</textarea>
</div>
<script>
var expected_direction_none;
setup(function() {
var input = document.createElement("input");
input.setSelectionRange(0, 1, "none");
var direction = input.selectionDirection;
if (direction !== "none" && direction !== "forward") {
throw new Error("Unexpected direction");
}
expected_direction_none = direction;
});
test(function() {
var input = document.getElementById("a");
test(function() {
@ -67,22 +78,22 @@ test(function() {
test(function() {
input.setSelectionRange(0,1,"none")
assert_equals(input.selectionDirection, "none", 'The direction of the selection must be set to forward if direction is a case-sensitive match for the string "none"');
assert_equals(input.selectionDirection, expected_direction_none);
},'input direction of setSelectionRange(0,1,"none")');
test(function() {
input.setSelectionRange(0,1,"hoge")
assert_equals(input.selectionDirection, "none", "otherwise");
assert_equals(input.selectionDirection, expected_direction_none);
},'input direction of setSelectionRange(0,1,"hoge")');
test(function() {
input.setSelectionRange(0,1,"BACKWARD")
assert_equals(input.selectionDirection, "none", "selectionDirection should be 'none'");
assert_equals(input.selectionDirection, expected_direction_none);
},'input direction of setSelectionRange(0,1,"BACKWARD")');
test(function() {
input.setSelectionRange(0,1)
assert_equals(input.selectionDirection, "none", "if the argument is omitted");
assert_equals(input.selectionDirection, expected_direction_none);
},'input direction of setSelectionRange(0,1)');
test(function() {
@ -214,22 +225,22 @@ test(function() {
test(function() {
textarea.setSelectionRange(0,1,"none")
assert_equals(textarea.selectionDirection, "none", 'The direction of the selection must be set to forward if direction is a case-sensitive match for the string "none"');
assert_equals(textarea.selectionDirection, expected_direction_none);
},'textarea direction of setSelectionRange(0,1,"none")');
test(function() {
textarea.setSelectionRange(0,1,"hoge")
assert_equals(textarea.selectionDirection, "none", "otherwise");
assert_equals(textarea.selectionDirection, expected_direction_none);
},'textarea direction of setSelectionRange(0,1,"hoge")');
test(function() {
textarea.setSelectionRange(0,1,"BACKWARD")
assert_equals(textarea.selectionDirection, "none", "selectionDirection should be 'none'");
assert_equals(textarea.selectionDirection, expected_direction_none);
},'textarea direction of setSelectionRange(0,1,"BACKWARD")');
test(function() {
textarea.setSelectionRange(0,1)
assert_equals(textarea.selectionDirection, "none", "if the argument is omitted");
assert_equals(textarea.selectionDirection, expected_direction_none);
},'textarea direction of setSelectionRange(0,1)');
test(function() {

View file

@ -42,7 +42,7 @@
}, "Indeterminate progress bar should have value 0");
test(function() {
assert_array_equals(largerthanmax.value, 1);
assert_equals(largerthanmax.value, 1);
}, "Value must equal max if the parsed value is larger than max");
test(function() {
@ -50,7 +50,7 @@
}, "Max must be 1 by default");
test(function() {
assert_array_equals(largerthanmax.max, 1);
assert_equals(largerthanmax.max, 1);
}, "Max must be 1 by default, even if value is specified");
test(function() {

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>HTMLSelectElement Test: add()</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-add-dev">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<form style="display:none">
<option id="testoption">
<select id="testselect1">
</select>
<select id="testselect2">
<option>TEST</option>
</select>
</option>
</form>
<script>
test(() => {
let testselect1 = document.getElementById("testselect1");
let opt1 = new Option("Marry","1");
testselect1.add(opt1);
assert_equals(testselect1.options[0].value, "1");
}, "test that HTMLSelectElement.add method can add option element");
test(() => {
let testselect2 = document.getElementById("testselect2");
let opt2 = document.getElementById("testoption");
assert_throws("HierarchyRequestError", () => {
testselect2.add(opt2);
});
}, "test that HierarchyRequestError exception must be thrown when element is an ancestor of the element into which it is to be inserted");
</script>

View file

@ -70,7 +70,7 @@ test(function () {
assertSelectedIndex(select, 0);
select.selectedIndex = 2;
assertSelectedIndex(select, 2);
this.add_cleanup(() => select.selectedIndex = 0);
this.add_cleanup(() => { select.selectedIndex = 0; });
}, "set (HTMLSelectElement)");
test(function () {
@ -78,7 +78,7 @@ test(function () {
assertSelectedIndex(select, 0);
select.options.selectedIndex = 2;
assertSelectedIndex(select, 2);
this.add_cleanup(() => select.selectedIndex = 0);
this.add_cleanup(() => { select.selectedIndex = 0; });
}, "set (HTMLOptionsCollection)");
test(function () {