]> source.dussan.org Git - jquery.git/commitdiff
Tests: Disable native abort test in Android 4.0
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Mon, 12 Feb 2018 18:08:36 +0000 (19:08 +0100)
committerGitHub <noreply@github.com>
Mon, 12 Feb 2018 18:08:36 +0000 (19:08 +0100)
The test works on its own when checked manually but mysteriously fails in
TestSwarm only in Android 4.0. Let's just disable it there.

Closes gh-3968

test/unit/ajax.js

index e1ecd2036fc0646c4c3c0f9359a56505c2664007..ff9fd8e7040ec3b6af608ac2db343b596420a211 100644 (file)
@@ -505,24 +505,26 @@ QUnit.module( "ajax", {
                };
        } );
 
-       ajaxTest( "jQuery.ajax() - native abort", 2, function( assert ) {
-               return {
-                       url: url( "mock.php?action=wait&wait=1" ),
-                       xhr: function() {
-                               var xhr = new window.XMLHttpRequest();
-                               setTimeout( function() {
-                                       xhr.abort();
-                               }, 100 );
-                               return xhr;
-                       },
-                       error: function( xhr, msg ) {
-                               assert.strictEqual( msg, "error", "Native abort triggers error callback" );
-                       },
-                       complete: function() {
-                               assert.ok( true, "complete" );
-                       }
-               };
-       } );
+       if ( !/android 4\.0/i.test( navigator.userAgent ) ) {
+               ajaxTest( "jQuery.ajax() - native abort", 2, function( assert ) {
+                       return {
+                               url: url( "mock.php?action=wait&wait=1" ),
+                               xhr: function() {
+                                       var xhr = new window.XMLHttpRequest();
+                                       setTimeout( function() {
+                                               xhr.abort();
+                                       }, 100 );
+                                       return xhr;
+                               },
+                               error: function( xhr, msg ) {
+                                       assert.strictEqual( msg, "error", "Native abort triggers error callback" );
+                               },
+                               complete: function() {
+                                       assert.ok( true, "complete" );
+                               }
+                       };
+               } );
+       }
 
        // Support: Android <= 4.0 - 4.3 only
        // Android 4.0-4.3 does not have ontimeout on an xhr