blob: c5d8a292711867d6aab312b81948d463fcae1e5c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<!DOCTYPE HTML>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
function test1(elementType) {
test(function() {
var element = document.createElement(elementType);
element.setCustomValidity('');
assert_equals(element.validationMessage, '');
element.setCustomValidity(null);
assert_equals(element.validationMessage, 'null');
element.setCustomValidity(undefined);
assert_equals(element.validationMessage, 'undefined');
}, elementType + ' element test for setCustomValidity(), null and undefined arguments.');
}
function test2(elementType) {
test(function() {
var element = document.createElement(elementType);
element.setCustomValidity('');
assert_equals(element.validationMessage, '');
element.setCustomValidity(null);
assert_equals(element.validationMessage, '');
element.setCustomValidity(undefined);
assert_equals(element.validationMessage, '');
}, elementType + ' element test for setCustomValidity(), null and undefined arguments.');
}
test1('button');
test1('input');
test1('textarea');
test1('select');
test2('output');
test2('fieldset');
test2('object');
test2('keygen');
</script>
</html>
|