| OLD | NEW |
| 1 <script src="../../resources/js-test.js"></script> | 1 <script src="../../resources/js-test.js"></script> |
| 2 <script> | 2 <script> |
| 3 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.") | 3 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.") |
| 4 | 4 |
| 5 // Creating UIEvent. | 5 // Creating UIEvent. |
| 6 var uievent = document.createEvent('UIEvent'); | 6 var uievent = document.createEvent('UIEvent'); |
| 7 shouldBeNonNull("uievent"); | 7 shouldBeNonNull("uievent"); |
| 8 shouldBeNull("uievent.sourceDevice"); | 8 shouldBeNull("uievent.sourceDevice"); |
| 9 | 9 |
| 10 uievent = new UIEvent('eventType', { sourceDevice: new InputDevice({ firesTo
uchEvents: false }) }); | 10 uievent = new UIEvent('eventType', { sourceDevice: new InputDevice({ firesTo
uchEvents: false }) }); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // Creating MouseEvent. | 23 // Creating MouseEvent. |
| 24 var mouseevent = new MouseEvent('mousedown'); | 24 var mouseevent = new MouseEvent('mousedown'); |
| 25 shouldBeNonNull("mouseevent"); | 25 shouldBeNonNull("mouseevent"); |
| 26 shouldBeNull("mouseevent.sourceDevice"); | 26 shouldBeNull("mouseevent.sourceDevice"); |
| 27 | 27 |
| 28 var mouseevent = new MouseEvent('mousedown', { sourceDevice: new InputDevice
({ firesTouchEvents: false }) }); | 28 var mouseevent = new MouseEvent('mousedown', { sourceDevice: new InputDevice
({ firesTouchEvents: false }) }); |
| 29 shouldBeNonNull("mouseevent.sourceDevice"); | 29 shouldBeNonNull("mouseevent.sourceDevice"); |
| 30 shouldBeFalse("mouseevent.sourceDevice.firesTouchEvents"); | 30 shouldBeFalse("mouseevent.sourceDevice.firesTouchEvents"); |
| 31 | 31 |
| 32 |
| 33 // Creating KeyboardEvent. |
| 34 var keyboardevent = new KeyboardEvent("keydown"); |
| 35 shouldBeNonNull("keyboardevent"); |
| 36 shouldBeNull("keyboardevent.sourceDevice"); |
| 37 |
| 38 keyboardevent = new KeyboardEvent("keydown", { sourceDevice: new InputDevice
({ firesTouchEvents: false }) }); |
| 39 shouldBeNonNull("keyboardevent.sourceDevice"); |
| 40 shouldBeFalse("keyboardevent.sourceDevice.firesTouchEvents"); |
| 41 |
| 32 </script> | 42 </script> |
| OLD | NEW |