Permalink
Browse files

Adding touchevents test.

  • Loading branch information...
1 parent f906014 commit a279473d1badb003361ce2a79d360b5e3a268853 @mattwkelly mattwkelly committed Apr 10, 2012
Showing with 50 additions and 0 deletions.
  1. +5 −0 tests/touchevents/config.yml
  2. +45 −0 tests/touchevents/test.js
@@ -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
@@ -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" );
+ });
+});

0 comments on commit a279473

Please sign in to comment.