OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>InputEvent: Constructor test</title> |
| 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <div id="log"></div> |
| 6 <script> |
| 7 test(function() { |
| 8 assert_throws({name: 'TypeError'}, |
| 9 function() { new InputEvent(); }, |
| 10 "Construct InputEvent with no argument."); |
| 11 }, "Checks for InputEvent constructor with not enough argument"); |
| 12 |
| 13 test(function() { |
| 14 var e = new InputEvent('beforeinput'); |
| 15 assert_true(e instanceof InputEvent); |
| 16 assert_equals(e.type, 'beforeinput'); |
| 17 assert_equals(e.bubbles, false); |
| 18 }, "Checks for InputEvent constructor with one argument"); |
| 19 |
| 20 test(function() { |
| 21 var e = new InputEvent('input', {'bubbles': true}); |
| 22 assert_true(e instanceof InputEvent); |
| 23 assert_equals(e.type, 'input'); |
| 24 assert_equals(e.bubbles, true); |
| 25 }, "Checks for InputEvent constructor with full arguments"); |
| 26 </script> |
OLD | NEW |