Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding touchevents test.

  • Loading branch information...
commit a279473d1badb003361ce2a79d360b5e3a268853 1 parent f906014
@mattwkelly mattwkelly authored
Showing with 50 additions and 0 deletions.
  1. +5 −0 tests/touchevents/config.yml
  2. +45 −0 tests/touchevents/test.js
View
5 tests/touchevents/config.yml
@@ -0,0 +1,5 @@
+---
+ r: 1
+ spec: "http://www.w3.org/TR/touch-events/"
+ sources: ["https://developer.apple.com/library/safari/#documentation/UserExperience/Reference/TouchEventClassReference/TouchEvent/TouchEvent.html#//apple_ref/doc/uid/TP40009358"]
+ title: "Touch Event"
View
45 tests/touchevents/test.js
@@ -0,0 +1,45 @@
+test("Touch", function() {
+ var Touch = H.API( window, "Touch", true );
+
+ assert( !!Touch, "Touch supported" );
+});
+
+test("TouchEvent", function() {
+ var TouchEvent = H.API( window, "TouchEvent", true );
+
+ assert( !!TouchEvent, "TouchEvent supported" );
+});
+
+test("TouchList", function() {
+ var TouchList = H.API( window, "TouchList", true );
+
+ assert( !!TouchList, "TouchList supported" );
+});
+
+// test("DocumentTouch", function() {
+// var DocumentTouch = H.API( window, "DocumentTouch", true );
+//
+//
+// assert( !!DocumentTouch );
+// });
+
+test("createTouch", function() {
+ assert( "createTouch" in document, "createTouch supported" );
+});
+
+
+[ "touchstart", "touchend", "touchcancel", "touchmove"/*, "touchleave"*/ ].forEach(function( event ) {
+ event = "on" + event;
+
+ test("Touch Events: " + event, function() {
+ assert( event in window, event + " supported" );
+ });
+});
+
+[ "gesturestart", "gestureend", "gesturechange" ].forEach(function( event ) {
+ event = "on" + event;
+
+ test("Gesture Events: " + event, function() {
+ assert( event in window, event + " supported" );
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.