Browse files

added tap hold test

  • Loading branch information...
1 parent 2931fff commit 16ed9dc661881d61d9550a3ef8342f60894f4b01 @johnbender johnbender committed Dec 5, 2010
Showing with 30 additions and 0 deletions.
  1. +30 −0 tests/unit/event/event_core.js
View
30 tests/unit/event/event_core.js
@@ -108,5 +108,35 @@
start();
ok(triggered);
}, 50);
+
+ //NOTE async tests below won't fire unless start is called (??)
+ start();
+ });
+
+ test( "long press fires tap hold after 750 ms", function(){
+ var taphold = false;
+ $.support.touch = true;
+
+ $.testHelper.reloadLib(libName);
+
+ stop();
+ $($.event.special.tap).bind("taphold", function(){
+ start();
+ taphold = true;
+ });
+
+ $($.event.special.tap).trigger("touchstart");
+
+ stop();
+ setTimeout(function(){
+ start();
+ ok(!taphold);
+ }, 749);
+
+ stop();
+ setTimeout(function(){
+ start();
+ ok(taphold);
+ }, 751);
});
})(jQuery);

0 comments on commit 16ed9dc

Please sign in to comment.