add setTimeout to Queue so reporters get periodic updates

This commit is contained in:
ragaskar
2009-08-13 07:52:44 -07:00
parent 7b63960db0
commit 454d453207
7 changed files with 61 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
jasmine.Queue = function() {
jasmine.Queue = function(env) {
this.env = env;
this.blocks = [];
this.running = false;
this.index = 0;
@@ -37,13 +38,17 @@ jasmine.Queue.prototype.isRunning = function () {
jasmine.Queue.prototype._next = function () {
var self = this;
self.offset = 0;
self.index++;
if (self.index < self.blocks.length) {
self.blocks[self.index].execute(function () {self._next();});
} else {
self.finish();
}
self.env.setTimeout(function () {
self.offset = 0;
self.index++;
if (self.index < self.blocks.length) {
self.blocks[self.index].execute(function () {
self._next();
});
} else {
self.finish();
}
}, 0);
};
jasmine.Queue.prototype.finish = function () {