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

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

Issue 1161783006: Populates sourceDevice attribute into TouchEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Put touchevent in uievent layout test 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 <head>
2 <script src="../../resources/js-test.js"></script> 1 <script src="../../resources/js-test.js"></script>
3 </head>
4 <body>
5 <script> 2 <script>
6 description("This tests that UIEvent will have sourceDevice set to be null b y 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.")
7 4
8 var event = document.createEvent('UIEvent'); 5 var uievent = document.createEvent('UIEvent');
9 shouldBeNonNull("event"); 6 shouldBeNonNull("uievent");
10 shouldBeNull("event.sourceDevice"); 7 shouldBeNull("uievent.sourceDevice");
11 8
12 event = new UIEvent('eventType', { sourceDevice: new InputDevice({ firesTouc hEvents: false }) }); 9 uievent = new UIEvent('eventType', { sourceDevice: new InputDevice({ firesTo uchEvents: false }) });
13 shouldBeNonNull("event.sourceDevice"); 10 shouldBeNonNull("uievent.sourceDevice");
14 shouldBeFalse("event.sourceDevice.firesTouchEvents"); 11 shouldBeFalse("uievent.sourceDevice.firesTouchEvents");
15 12
16 event = new UIEvent('eventType', { sourceDevice: new InputDevice({ firesTouc hEvents: true }) }); 13 uievent = new UIEvent('eventType', { sourceDevice: new InputDevice({ firesTo uchEvents: true }) });
17 shouldBeNonNull("event.sourceDevice"); 14 shouldBeNonNull("uievent.sourceDevice");
18 shouldBeTrue("event.sourceDevice.firesTouchEvents"); 15 shouldBeTrue("uievent.sourceDevice.firesTouchEvents");
16
17 var touchevent = document.createEvent("TouchEvent");
18 shouldBeNonNull("touchevent");
19 shouldBeNull("touchevent.sourceDevice");
19 20
20 </script> 21 </script>
21 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698