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

Unified Diff: LayoutTests/fast/events/touch/touch-tilt.html

Issue 750013004: Added experimental tilt and tiltDirection to the Touch interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed WebInputEventConversionTest Created 5 years, 9 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/touch/touch-tilt.html
diff --git a/LayoutTests/fast/events/touch/touch-tilt.html b/LayoutTests/fast/events/touch/touch-tilt.html
new file mode 100644
index 0000000000000000000000000000000000000000..72279052865f1c76617e9bb8ba0140f94978c7dd
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-tilt.html
@@ -0,0 +1,57 @@
+<script src="../../../resources/js-test.js"></script>
+
+<p id="description"></p>
+<div id="console"></div>
+<script type="text/javascript">
+description('Test verifies tilt and tiltDirection can be plumbed through correctly via eventSender');
+
+var touch = null;
+
+function onTouchEvent (event) {
+ shouldBeNull('touch');
+ touch = event.touches[0];
+}
+document.addEventListener('touchstart', onTouchEvent, false);
+document.addEventListener('touchmove' , onTouchEvent, false);
+
+if (window.eventSender) {
+ eventSender.clearTouchPoints();
+ eventSender.addTouchPoint(100, 100);
+ eventSender.touchStart();
+ touch = null;
+
+ eventSender.updateTouchPoint(0, 110, 110);
+ debug('Sending touchmove (1)');
+ eventSender.touchMove();
+ shouldBeNonNull('touch');
+ shouldBeNaN('touch.tilt');
+ shouldBeNaN('touch.tiltDirection');
+ touch = null;
+
+ eventSender.clearTouchPoints();
+ eventSender.touchEnd();
+ eventSender.addTouchPoint(100, 100);
+ if (eventSender.setTouchPointTilt)
+ eventSender.setTouchPointTilt(0, 15, 30, false);
+ eventSender.touchStart();
+ if (eventSender.setTouchPointTilt) {
+ shouldBe('touch.tilt', '15');
+ shouldBe('touch.tiltDirection', '30');
+ }
+ touch = null;
+
+ if (eventSender.setTouchPointTilt)
+ eventSender.setTouchPointTilt(0, 45, 60, true);
+ debug('Sending touchmove (2)');
+ eventSender.touchMove();
+ shouldBeNonNull('touch');
+ if (eventSender.setTouchPointTilt) {
+ shouldBe('touch.tilt', '45');
+ shouldBe('touch.tiltDirection', '60');
+ }
+ touch = null;
+} else {
+ debug('This test requires --dump-render-tree.');
+}
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698