Permalink
Browse files

Update QUnit to make it work in Firefox < 4.

  • Loading branch information...
NV committed Dec 11, 2010
1 parent 83a33a6 commit a9cf8e6deaf6000a38ebffc2a1d7d12fee4c0023
Showing with 14 additions and 24 deletions.
  1. +14 −24 test/vendor/qunit.js
View
@@ -12,7 +12,13 @@
var defined = {
setTimeout: typeof window.setTimeout !== "undefined",
sessionStorage: typeof window.sessionStorage !== "undefined"
sessionStorage: (function() {
try {
return !!sessionStorage.getItem;
} catch(e){
return false;
}
})()
}
var testId = 0;
@@ -39,10 +45,11 @@ Test.prototype = {
}
},
setup: function() {
if (this.module != this.previousModule) {
if (this.module != config.previousModule) {
if ( this.previousModule ) {
QUnit.moduleDone( this.module, config.moduleStats.bad, config.moduleStats.all );
}
config.previousModule = this.module;
config.moduleStats = { all: 0, bad: 0 };
QUnit.moduleStart( this.module, this.moduleTestEnvironment );
}
@@ -268,7 +275,6 @@ var QUnit = {
test.module = config.currentModule;
test.moduleTestEnvironment = config.currentModuleTestEnviroment;
test.queue();
synchronize( done );
},
/**
@@ -335,10 +341,10 @@ var QUnit = {
raises: function(fn, message) {
try {
fn();
ok( false, message );
QUnit.ok( false, message );
}
catch (e) {
ok( true, message );
QUnit.ok( true, message );
}
},
@@ -640,25 +646,6 @@ addEvent(window, "load", function() {
});
function done() {
if ( config.doneTimer && window.clearTimeout ) {
window.clearTimeout( config.doneTimer );
config.doneTimer = null;
}
if ( config.queue.length ) {
if ( defined.setTimeout ) {
config.doneTimer = window.setTimeout(function(){
if ( !config.queue.length ) {
done();
} else {
synchronize( done );
}
}, 13);
}
return;
}
config.autorun = true;
// Log the last module results
@@ -776,6 +763,9 @@ function process() {
break;
}
}
if (!config.blocking && !config.queue.length) {
done();
}
}
function saveGlobal() {

0 comments on commit a9cf8e6

Please sign in to comment.