diff options
author | Erik Lax <erik@datahack.se> | 2017-03-23 14:33:25 +0100 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2017-07-24 11:44:09 -0400 |
commit | 262acc6f1e0f71a3a8b786e3c421b2e645799ea0 (patch) | |
tree | d6b57361c556b2a13e73454b746733ae2795ece4 /test/unit/ajax.js | |
parent | d65bdd5fc8edf390211ed2223a03c6a00a41c649 (diff) | |
download | jquery-262acc6f1e0f71a3a8b786e3c421b2e645799ea0.tar.gz jquery-262acc6f1e0f71a3a8b786e3c421b2e645799ea0.zip |
Ajax: add an ontimeout handler to all requests
Fixes gh-3586
Close gh-3590
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r-- | test/unit/ajax.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 07ff40783..4dc7b9d3a 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -527,6 +527,23 @@ QUnit.module( "ajax", { }; } ); + ajaxTest( "jQuery.ajax() - native timeout", 2, function( assert ) { + return { + url: url( "data/name.php?wait=1" ), + xhr: function() { + var xhr = new window.XMLHttpRequest(); + xhr.timeout = 1; + return xhr; + }, + error: function( xhr, msg ) { + assert.strictEqual( msg, "error", "Native timeout triggers error callback" ); + }, + complete: function() { + assert.ok( true, "complete" ); + } + }; + } ); + ajaxTest( "jQuery.ajax() - events with context", 12, function( assert ) { var context = document.createElement( "div" ); |