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