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 |
| index d5ef4d67d12af2d22e49541a49af41a1b2e8085f..0f7ac7e6eabc785562f1cbfe7608c15c9e562a76 100644 |
| --- a/LayoutTests/fast/events/uievent-with-inputdevice.html |
| +++ b/LayoutTests/fast/events/uievent-with-inputdevice.html |
| @@ -2,6 +2,7 @@ |
| <script> |
| description("This tests that UIEvent and its subclass will have sourceDevice set to be null by default, and it can also be passed when initialization.") |
| + // Creating UIEvent. |
| var uievent = document.createEvent('UIEvent'); |
| shouldBeNonNull("uievent"); |
| shouldBeNull("uievent.sourceDevice"); |
| @@ -14,8 +15,26 @@ |
| shouldBeNonNull("uievent.sourceDevice"); |
| shouldBeTrue("uievent.sourceDevice.firesTouchEvents"); |
| + // Creating TouchEvent. |
| var touchevent = document.createEvent("TouchEvent"); |
| shouldBeNonNull("touchevent"); |
| shouldBeNull("touchevent.sourceDevice"); |
| + |
| + // Creating MouseEvent. |
| + document.addEventListener("mousedown", function(event) { |
| + shouldBeNonNull("event"); |
| + shouldBeNull("event.sourceDevice"); |
| + }); |
| + |
| + var e = new MouseEvent('mousedown'); |
| + document.dispatchEvent(e); |
| + |
| + var sourceDevice = new InputDevice({ firesTouchEvents: false }); |
| + shouldBeFalse("sourceDevice.firesTouchEvents"); |
| + |
| + var mouseevent = document.createEvent("MouseEvents"); |
| + mouseevent.initMouseEvent("mousedown", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null, sourceDevice); |
|
Rick Byers
2015/06/23 00:55:57
nit: please use the 'new MouseEvent' style instead
lanwei
2015/06/23 22:19:20
Done.
|
| + shouldBeNonNull("mouseevent.sourceDevice"); |
| + shouldBeFalse("mouseevent.sourceDevice.firesTouchEvents"); |
| -</script> |
| +</script> |