Commit 84dd82eb authored by jeresig's avatar jeresig

Add some abort() Ajax tests. Verifies that #3984 works.

parent e424e01c
...@@ -70,6 +70,30 @@ test("jQuery.ajax() - error callbacks", function() { ...@@ -70,6 +70,30 @@ test("jQuery.ajax() - error callbacks", function() {
}); });
}); });
test("jQuery.ajax() - abort", function() {
expect( 6 );
stop();
jQuery('#foo').ajaxStart(function(){
ok( true, "ajaxStart" );
}).ajaxStop(function(){
ok( true, "ajaxStop" );
start();
}).ajaxSend(function(){
ok( true, "ajaxSend" );
}).ajaxComplete(function(){
ok( true, "ajaxComplete" );
});
var xhr = jQuery.ajax({
url: url("data/name.php?wait=5"),
beforeSend: function(){ ok(true, "beforeSend"); },
complete: function(){ ok(true, "complete"); }
});
xhr.abort();
});
test("Ajax events with context", function() { test("Ajax events with context", function() {
expect(6); expect(6);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment