зеркало из https://github.com/mozilla/gecko-dev.git
Bug 598165 - Remove flaky Prototype tests testUpdaterWithInsertion and testResponders; r=ehsan
This commit is contained in:
Родитель
5afbe93b01
Коммит
b15d9492ff
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче