mshtml/tests: Added more IDOMEvent::preventDefault tests.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-03-08 08:56:38 -06:00 committed by Alexandre Julliard
parent 39766bcded
commit e36b765be4
1 changed files with 14 additions and 0 deletions

View File

@ -358,6 +358,7 @@ function test_prevent_default() {
elem.onclick = function(event) {
event.preventDefault();
ok(event.defaultPrevented === false, "defaultPrevented");
}
e = document.createEvent("Event");
e.initEvent("click", true, false);
@ -372,6 +373,19 @@ function test_prevent_default() {
r = elem.dispatchEvent(e);
ok(r === true, "dispatchEvent returned " + r);
e = document.createEvent("Event");
e.initEvent("click", false, true);
e.preventDefault();
ok(e.defaultPrevented === false, "defaultPrevented = " + e.defaultPrevented);
e = document.createEvent("Event");
e.initEvent("click", false, true);
elem.onclick = null;
r = elem.dispatchEvent(e);
ok(r === true, "dispatchEvent returned " + r);
e.preventDefault();
ok(e.defaultPrevented === false, "defaultPrevented = " + e.defaultPrevented);
next_test();
}