@@ -524,22 +524,26 @@ QUnit.module( "ajax", {
524
524
} ;
525
525
} ) ;
526
526
527
- ajaxTest ( "jQuery.ajax() - native timeout" , 2 , function ( assert ) {
528
- return {
529
- url : url ( "mock.php?action=wait&wait=1" ) ,
530
- xhr : function ( ) {
531
- var xhr = new window . XMLHttpRequest ( ) ;
532
- xhr . timeout = 1 ;
533
- return xhr ;
534
- } ,
535
- error : function ( xhr , msg ) {
536
- assert . strictEqual ( msg , "error" , "Native timeout triggers error callback" ) ;
537
- } ,
538
- complete : function ( ) {
539
- assert . ok ( true , "complete" ) ;
540
- }
541
- } ;
542
- } ) ;
527
+ // Support: Android <= 4.0 - 4.3 only
528
+ // Android 4.0-4.3 does not have ontimeout on an xhr
529
+ if ( "ontimeout" in new window . XMLHttpRequest ( ) ) {
530
+ ajaxTest ( "jQuery.ajax() - native timeout" , 2 , function ( assert ) {
531
+ return {
532
+ url : url ( "mock.php?action=wait&wait=1" ) ,
533
+ xhr : function ( ) {
534
+ var xhr = new window . XMLHttpRequest ( ) ;
535
+ xhr . timeout = 1 ;
536
+ return xhr ;
537
+ } ,
538
+ error : function ( xhr , msg ) {
539
+ assert . strictEqual ( msg , "error" , "Native timeout triggers error callback" ) ;
540
+ } ,
541
+ complete : function ( ) {
542
+ assert . ok ( true , "complete" ) ;
543
+ }
544
+ } ;
545
+ } ) ;
546
+ }
543
547
544
548
ajaxTest ( "jQuery.ajax() - events with context" , 12 , function ( assert ) {
545
549
var context = document . createElement ( "div" ) ;
0 commit comments