Bug 598165 - Remove flaky Prototype tests testUpdaterWithInsertion and testResponders; r=ehsan

This commit is contained in:
Justin Lebar 2011-05-27 18:51:20 -04:00
Родитель 5afbe93b01
Коммит b15d9492ff
1 изменённых файлов: 0 добавлений и 56 удалений

Просмотреть файл

@ -59,25 +59,6 @@ new Test.Unit.Runner({
});
},
testUpdaterWithInsertion: function() {
$('content').update();
new Ajax.Updater("content", "../fixtures/content.html", { method:'get', insertion: Insertion.Top });
this.wait(1000, function() {
// bug 452706 this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
$('content').update();
new Ajax.Updater("content", "../fixtures/content.html", { method:'get', insertion: 'bottom' });
this.wait(1000, function() {
this.assertEqual(sentence, $("content").innerHTML.strip().toLowerCase());
$('content').update();
new Ajax.Updater("content", "../fixtures/content.html", { method:'get', insertion: 'after' });
this.wait(1000, function() {
this.assertEqual('five dozen', $("content").next().innerHTML.strip().toLowerCase());
});
});
});
},
testUpdaterOptions: function() {
var options = {
method: 'get',
@ -90,43 +71,6 @@ new Test.Unit.Runner({
this.assertIdentical(Prototype.emptyFunction, options.onComplete);
},
testResponders: function(){
// check for internal responder
this.assertEqual(1, Ajax.Responders.responders.length);
var dummyResponder = {
onComplete: function(req) { /* dummy */ }
};
Ajax.Responders.register(dummyResponder);
this.assertEqual(2, Ajax.Responders.responders.length);
// don't add twice
Ajax.Responders.register(dummyResponder);
this.assertEqual(2, Ajax.Responders.responders.length);
Ajax.Responders.unregister(dummyResponder);
this.assertEqual(1, Ajax.Responders.responders.length);
var responder = {
onCreate: function(req){ responderCounter++ },
onLoading: function(req){ responderCounter++ },
onComplete: function(req){ responderCounter++ }
};
Ajax.Responders.register(responder);
this.assertEqual(0, responderCounter);
this.assertEqual(0, Ajax.activeRequestCount);
new Ajax.Request("../fixtures/content.html", { method:'get', parameters:"pet=monkey" });
this.assertEqual(1, responderCounter);
this.assertEqual(1, Ajax.activeRequestCount);
this.wait(1000,function() {
this.assertEqual(3, responderCounter);
this.assertEqual(0, Ajax.activeRequestCount);
});
},
testEvalResponseShouldBeCalledBeforeOnComplete: function() {
if (this.isRunningFromRake) {
this.assertEqual("", $("content").innerHTML);