aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorDavid Serduke <davidserduke@gmail.com>2007-12-05 23:03:58 +0000
committerDavid Serduke <davidserduke@gmail.com>2007-12-05 23:03:58 +0000
commitbe4a8c32ac77c3b1cdf1b598943b23bdb3119467 (patch)
treea3483838f734e9ab5b785e50e1604050a09c12f8 /test/unit/ajax.js
parent7cdddebe047302f51c4fd30823565f3ac1553d60 (diff)
downloadjquery-be4a8c32ac77c3b1cdf1b598943b23bdb3119467.tar.gz
jquery-be4a8c32ac77c3b1cdf1b598943b23bdb3119467.zip
Safari sometimes stops in the test suite on the ajax section when I run the whole suite and its running on my local machine. I went ahead and put better error detection in for the test that is the culprit so it will keep going. It seems to do fine if I run it from a server. It gives xml.status as 0. Maybe this is the reason http://www.pearweb.com/javascript/XMLHttpRequest.html
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 5274b6850..84d35188d 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -218,16 +218,26 @@ test("synchronous request with callbacks", function() {
});
test("pass-through request object", function() {
- expect(6);
+ expect(8);
stop(true);
var target = "data/name.html";
- var count = 0;
+ var successCount = 0;
+ var errorCount = 0;
+ var errorEx = "";
var success = function() {
- // Re-enabled because a bug was found in the unit test that probably caused the problem
- if(++count == 5)
- start();
+ successCount++;
};
+ $("#foo").ajaxError(function (e, xml, s, ex) {
+ errorCount++;
+ errorEx += ": " + xml.status;
+ });
+ $("#foo").one('ajaxStop', function () {
+ equals(successCount, 5, "Check all ajax calls successful");
+ equals(errorCount, 0, "Check no ajax errors (status" + errorEx + ")");
+ $("#foo").unbind('ajaxError');
+ start();
+ });
ok( $.get(url(target), success), "get" );
ok( $.post(url(target), success), "post" );