Chromium Code Reviews| Index: LayoutTests/fast/events/uievent-with-inputdevice.html |
| diff --git a/LayoutTests/fast/events/uievent-with-inputdevice.html b/LayoutTests/fast/events/uievent-with-inputdevice.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1d8b650b88bdf3f801876a85204717df76ad1e3c |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/uievent-with-inputdevice.html |
| @@ -0,0 +1,31 @@ |
| +<head> |
| +<script src="../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<script> |
| + description("This tests that all the subclasses of UIEvent will have sourceDevice.firesTouchEvents set to be false by default, but it can also be passed when initialization.") |
| + |
| + if (window.testRunner) { |
| + testRunner.dumpAsText(); |
| + } |
| + |
| + var firesTouchEvents = false; |
| + document.addEventListener("click", function(event) { |
| + firesTouchEvents = event.sourceDevice.firesTouchEvents; |
|
Rick Byers
2015/06/04 14:52:35
sourceDevice is actually supposed to be null here
tdresser
2015/06/04 15:34:24
Oops, thanks Rick.
I caught that here(https://cod
|
| + }); |
| + |
| + var e = new MouseEvent('click'); |
| + |
| + document.dispatchEvent(e); |
| + |
| + shouldBeFalse('firesTouchEvents'); |
|
Rick Byers
2015/06/04 14:52:35
nit: move this shouldBe into the event handler its
|
| + |
| + if (window.internals) { |
| + internals.setFiresTouchEvents(e, true); |
|
Rick Byers
2015/06/04 14:52:35
I don't think this internals API is worth the cost
|
| + } |
| + document.dispatchEvent(e); |
| + |
| + shouldBeTrue('firesTouchEvents'); |
| + |
| +</script> |
| +</body> |