Skip to content

Commit

Permalink
Adding touchevents test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwkelly committed Apr 10, 2012
1 parent f906014 commit a279473
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 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"
45 changes: 45 additions & 0 deletions 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" );
});
});

0 comments on commit a279473

Please sign in to comment.