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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9ce4f05ddd3fc763767cd0128c1bc9897895f3e0 |
--- /dev/null |
+++ b/LayoutTests/fast/events/uievent-with-inputdevice.html |
@@ -0,0 +1,29 @@ |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<script> |
+ description("This tests that all the subclasses of UIEvent will have sourceDevice set to be null by default, and it can also be passed when initialization.") |
tdresser
2015/06/01 17:36:46
We aren't actually checking if sourceDevice is set
|
+ |
+ if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ } |
+ |
+ var firesTouchEvents = false; |
+ document.addEventListener("click", function(event) { firesTouchEvents = event.sourceDevice.firesTouchEvents; } ); |
+ |
+ var e = new MouseEvent('click'); |
+ |
+ document.dispatchEvent(e); |
+ |
+ shouldBeFalse('firesTouchEvents'); |
+ |
+ if (window.internals) { |
+ internals.setFiresTouchEvents(e, true); |
+ } |
+ document.dispatchEvent(e); |
+ |
+ shouldBeTrue('firesTouchEvents'); |
+ |
+</script> |
+</body> |