aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-03-07 15:39:39 +0100
committerjaubourg <j@ubourg.net>2012-03-07 15:39:39 +0100
commit484cea1b5651d215a24d3a6827663a4e16a6a253 (patch)
tree82e6de08b25eb70714f80e4f0dda299762897349 /test
parent014b2a57007c4fd2bc85397f83fe36eec88aa975 (diff)
downloadjquery-484cea1b5651d215a24d3a6827663a4e16a6a253.tar.gz
jquery-484cea1b5651d215a24d3a6827663a4e16a6a253.zip
Fixes #11426: getting the responseText of an xhr should be tried/caught because of IE's inability to give access to binary data. Unit test added.
Diffstat (limited to 'test')
-rw-r--r--test/data/1x1.jpgbin0 -> 693 bytes
-rw-r--r--test/unit/ajax.js14
2 files changed, 14 insertions, 0 deletions
diff --git a/test/data/1x1.jpg b/test/data/1x1.jpg
new file mode 100644
index 000000000..b0d69110f
--- /dev/null
+++ b/test/data/1x1.jpg
Binary files differ
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 38ce7c479..cca457db1 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -2322,6 +2322,20 @@ test("jQuery.ajax - abort in prefilter", function() {
});
+test( "jQuery.ajax - loading binary data shouldn't throw an exception in IE (#11426)", 1, function() {
+ stop();
+ jQuery.ajax( url( "data/1x1.jpg" ), {
+ success: function( data ) {
+ ok( data === undefined || /JFIF/.test( data ) , "success callback reached" );
+ start();
+ },
+ error: function( _, __, error ) {
+ ok( false, "exception thrown: '" + error + "'" );
+ start();
+ }
+ });
+});
+
test("jQuery.ajax - active counter", function() {
ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
});