git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7cdddeb
)
Safari sometimes stops in the test suite on the ajax section when I run the whole...
author
David Serduke
<davidserduke@gmail.com>
Wed, 5 Dec 2007 23:03:58 +0000
(23:03 +0000)
committer
David Serduke
<davidserduke@gmail.com>
Wed, 5 Dec 2007 23:03:58 +0000
(23:03 +0000)
test/unit/ajax.js
patch
|
blob
|
history
diff --git
a/test/unit/ajax.js
b/test/unit/ajax.js
index
5274b68
..
84d3518
100644
(file)
--- 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() {
});
test("pass-through request object", function() {
- expect(6);
+ expect(8);
stop(true);
var target = "data/name.html";
stop(true);
var target = "data/name.html";
- var count = 0;
+ var successCount = 0;
+ var errorCount = 0;
+ var errorEx = "";
var success = function() {
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" );
ok( $.get(url(target), success), "get" );
ok( $.post(url(target), success), "post" );