]> source.dussan.org Git - jquery.git/commitdiff
fixes problematic JSONP test (gotta learn to count)
authorjaubourg <j@ubourg.net>
Tue, 16 Oct 2012 14:02:44 +0000 (10:02 -0400)
committerjaubourg <j@ubourg.net>
Tue, 16 Oct 2012 14:03:17 +0000 (10:03 -0400)
test/unit/ajax.js

index 958403c929c9f01c205fb699e2c984e06feda1c0..c11b8b52f7ed92afbdb0a0148b3dd52e0340ddde 100644 (file)
@@ -1519,12 +1519,12 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
                        });
                });
 
-/*             asyncTest( "jQuery.ajax() - JSONP, Explicit jsonp/Callback param " + label, function() {
+               asyncTest( "jQuery.ajax() - JSONP, Explicit jsonp/Callback param " + label, function() {
                        expect( 9 );
 
                        var count = 0;
                        function plus() {
-                               if ( ++count === 4 ) {
+                               if ( ++count === 7 ) {
                                        start();
                                }
                        }
@@ -1543,7 +1543,7 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
                                        plus();
                                }
                        });
-
+                       
                        window["jsonpResults"] = function( data ) {
                                ok( data["data"], "JSON results returned (GET, custom callback function)" );
                                window["jsonpResults"] = undefined;
@@ -1594,6 +1594,7 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
                                error: function( data ) {
                                        ok( false, "Ajax error JSON (GET, custom callback name to be cleaned up)" );
                                        plus();
+                                       plus();
                                }
                        });
 
@@ -1617,7 +1618,6 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
                                }
                        });
                });
-*/
 
                asyncTest( "jQuery.ajax() - JSONP, Callback in data, " + label, function() {
                        expect( 2 );