Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: LayoutTests/fast/events/uievent-with-inputdevice.html

Issue 1182313006: Populates sourceDevice attribute into KeyboardEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698