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

Unified 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: Do not use init&Event 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 side-by-side diff with in-line comments
Download patch
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..6557852b16197420095495a78fd73317dd4a8227 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,18 @@
shouldBeNonNull("uievent.sourceDevice");
shouldBeTrue("uievent.sourceDevice.firesTouchEvents");
+ // Creating TouchEvent.
var touchevent = document.createEvent("TouchEvent");
shouldBeNonNull("touchevent");
shouldBeNull("touchevent.sourceDevice");
+
+ // Creating KeyboardEvent.
+ var keyboardevent = new KeyboardEvent("keydown");
+ shouldBeNonNull("keyboardevent");
+ shouldBeNull("keyboardevent.sourceDevice");
+
+ keyboardevent = new KeyboardEvent("keydown", { sourceDevice: new InputDevice({ firesTouchEvents: false }) });
+ shouldBeNonNull("keyboardevent.sourceDevice");
+ shouldBeFalse("keyboardevent.sourceDevice.firesTouchEvents");
-</script>
+</script>

Powered by Google App Engine
This is Rietveld 408576698