| OLD | NEW |
| 1 module("ajax", { teardown: moduleTeardown }); | 1 module("ajax", { teardown: moduleTeardown }); |
| 2 | 2 |
| 3 // Safari 3 randomly crashes when running these tests, | 3 // Safari 3 randomly crashes when running these tests, |
| 4 // but only in the full suite - you can run just the Ajax | 4 // but only in the full suite - you can run just the Ajax |
| 5 // tests and they'll pass | 5 // tests and they'll pass |
| 6 //if ( !jQuery.browser.safari ) { | 6 //if ( !jQuery.browser.safari ) { |
| 7 | 7 |
| 8 if ( !isLocal ) { | 8 if ( !isLocal ) { |
| 9 | 9 |
| 10 test("jQuery.ajax() - success callbacks", function() { | 10 test("jQuery.ajax() - success callbacks", function() { |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 }); | 1008 }); |
| 1009 | 1009 |
| 1010 test("synchronous request", function() { | 1010 test("synchronous request", function() { |
| 1011 expect(1); | 1011 expect(1); |
| 1012 ok( /^{ "data"/.test( jQuery.ajax({url: url("data/json_obj.js"), dataTyp
e: "text", async: false}).responseText ), "check returned text" ); | 1012 ok( /^{ "data"/.test( jQuery.ajax({url: url("data/json_obj.js"), dataTyp
e: "text", async: false}).responseText ), "check returned text" ); |
| 1013 }); | 1013 }); |
| 1014 | 1014 |
| 1015 test("synchronous request with callbacks", function() { | 1015 test("synchronous request with callbacks", function() { |
| 1016 expect(2); | 1016 expect(2); |
| 1017 var result; | 1017 var result; |
| 1018 » jQuery.ajax({url: url("data/json_obj.js"), async: false, dataType: "text
", success: function(data) { ok(true, "sucess callback executed"); result = data
; } }); | 1018 » jQuery.ajax({url: url("data/json_obj.js"), async: false, dataType: "text
", success: function(data) { ok(true, "success callback executed"); result = dat
a; } }); |
| 1019 ok( /^{ "data"/.test( result ), "check returned text" ); | 1019 ok( /^{ "data"/.test( result ), "check returned text" ); |
| 1020 }); | 1020 }); |
| 1021 | 1021 |
| 1022 test("pass-through request object", function() { | 1022 test("pass-through request object", function() { |
| 1023 expect(8); | 1023 expect(8); |
| 1024 stop(); | 1024 stop(); |
| 1025 | 1025 |
| 1026 var target = "data/name.html"; | 1026 var target = "data/name.html"; |
| 1027 var successCount = 0; | 1027 var successCount = 0; |
| 1028 var errorCount = 0; | 1028 var errorCount = 0; |
| (...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2242 }), false, "Request was properly aborted early by the prefilter" ); | 2242 }), false, "Request was properly aborted early by the prefilter" ); |
| 2243 | 2243 |
| 2244 }); | 2244 }); |
| 2245 | 2245 |
| 2246 test("jQuery.ajax - active counter", function() { | 2246 test("jQuery.ajax - active counter", function() { |
| 2247 ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.acti
ve ); | 2247 ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.acti
ve ); |
| 2248 }); | 2248 }); |
| 2249 | 2249 |
| 2250 } | 2250 } |
| 2251 | 2251 |
| 2252 //} | 2252 //} |
| OLD | NEW |