Index: third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html |
diff --git a/third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html b/third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..29e0aed731ca1585e367e54edd098f0a9c85861b |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/forms/mouseevent_disabled_form_control.html |
@@ -0,0 +1,32 @@ |
+<!doctype html> |
+<html> |
+ <head> |
+ <title>Mouse Event</title> |
+ <meta name="viewport" content="width=device-width"> |
+ <script src="../../resources/testharness.js"></script> |
+ <script src="../../resources/testharnessreport.js"></script> |
+ </head> |
+ <body> |
+ <button id="target0" disabled>Disabled button</button> |
+ <script> |
+ var eventList = ['mouseout', 'mouseover', 'mouseenter', 'mousemove', 'mousedown', 'mouseup', 'mouseleave']; |
+ var target = document.getElementById("target0"); |
+ |
+ test((t) => { |
+ target.onclick = t.unreached_func("click should not fire on disabled element"); |
+ document.body.onclick = t.unreached_func("click should not fire on event path"); |
+ target.click(); |
+ target.dispatchEvent(new MouseEvent('click', {capture: true, bubbles: true})); |
+ }); |
jbroman
2017/04/24 19:50:32
super-nit: include test name (else you will get a
dtapuska
2017/04/24 19:59:29
Done.
|
+ |
+ for (let eventName of eventList) { |
+ test((t) => { |
+ let fired = false; |
+ on_event(target, eventName, () => fired = true); |
+ target.dispatchEvent(new MouseEvent(eventName, {capture: true, bubbles: true})); |
+ assert_true(fired, eventName + ' should be fired'); |
+ }, eventName + ' should be fired'); |
+ } |
+ </script> |
+ </body> |
+</html> |