Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adding touchevents test. #11

Merged
merged 1 commit into from

2 participants

@mattwkelly

No description provided.

@darobin darobin merged commit 4a23706 into coremob:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2012
  1. @mattwkelly

    Adding touchevents test.

    mattwkelly authored
This page is out of date. Refresh to see the latest.
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" );
+ });
+});
Something went wrong with that request. Please try again.