@@ -125,6 +125,13 @@ var forceTouchSupport = function() {
125
125
} ) ;
126
126
} ;
127
127
128
+ var forceNoTouchSupport = function ( ) {
129
+ $ . mobile . support . touch = false ;
130
+ $ . each ( components , function ( index , value ) {
131
+ $ . testHelper . reloadLib ( value ) ;
132
+ } ) ;
133
+ } ;
134
+
128
135
QUnit . asyncTest ( "long press fires tap hold after taphold duration" , function ( assert ) {
129
136
var taphold = false ,
130
137
target ;
@@ -477,6 +484,41 @@ QUnit.asyncTest( "scrolling prevented when coordinate change > 10", function( as
477
484
$ ( "#qunit-fixture" ) . trigger ( "touchmove" ) ;
478
485
} ) ;
479
486
487
+ QUnit . asyncTest ( "mouse action not prevented when coordinate change > 10" , function ( assert ) {
488
+ assert . expect ( 1 ) ;
489
+
490
+ forceNoTouchSupport ( ) ;
491
+
492
+ // Ensure the swipe custome event is setup
493
+ $ ( "#qunit-fixture" ) . bind ( "swipe" , function ( ) { } ) ;
494
+
495
+ $ . Event . prototype . preventDefault = function ( ) {
496
+ assert . ok ( false , "prevent default called" ) ;
497
+ } ;
498
+
499
+ $ ( "#qunit-fixture" ) . one ( "mouseup" , function ( ) {
500
+ QUnit . start ( ) ;
501
+ } ) ;
502
+
503
+ // NOTE bypass the trigger source check
504
+ $ . testHelper . mockOriginalEvent ( {
505
+ clientX : 0 ,
506
+ clientY : 0
507
+ } ) ;
508
+
509
+ $ ( "#qunit-fixture" ) . trigger ( "mousedown" ) ;
510
+
511
+ // NOTE bypass the trigger source check
512
+ $ . testHelper . mockOriginalEvent ( {
513
+ clientX : 200 ,
514
+ clientY : 0
515
+ } ) ;
516
+
517
+ $ ( "#qunit-fixture" ) . trigger ( "mousemove" ) ;
518
+
519
+ $ ( "#qunit-fixture" ) . trigger ( "mouseup" ) ;
520
+ } ) ;
521
+
480
522
QUnit . test ( "Swipe get cords returns proper values" , function ( assert ) {
481
523
var location ,
482
524
event = {
0 commit comments