blob: 826fa300ec4026381da2c0cbe36d72c3621a5551 [file] [log] [blame]
<!DOCTYPE html>
<title>InputEvent: Constructor test</title>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_throws_js(TypeError,
function() { new InputEvent(); },
"Construct InputEvent with no argument.");
}, "Checks for InputEvent constructor with not enough argument");
test(function() {
var e = new InputEvent('beforeinput');
assert_true(e instanceof InputEvent);
assert_equals(e.type, 'beforeinput');
assert_equals(e.bubbles, false);
}, "Checks for InputEvent constructor with one argument");
test(function() {
var e = new InputEvent('input', {'bubbles': true});
assert_true(e instanceof InputEvent);
assert_equals(e.type, 'input');
assert_equals(e.bubbles, true);
}, "Checks for InputEvent constructor with full arguments");
</script>