Skip to content

Commit

Permalink
Safari sometimes stops in the test suite on the ajax section when I r…
Browse files Browse the repository at this point in the history
…un 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
  • Loading branch information
davids549 committed Dec 5, 2007
1 parent 7cdddeb commit be4a8c3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/unit/ajax.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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); stop(true);


var target = "data/name.html"; 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 successCount++;
if(++count == 5)
start();
}; };
$("#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( $.get(url(target), success), "get" );
ok( $.post(url(target), success), "post" ); ok( $.post(url(target), success), "post" );
Expand Down

0 comments on commit be4a8c3

Please sign in to comment.