Modified example for css(String) as proposed in the list (concerning camlCase for dashed properties like font-weight); Modified test to cache test fixture instead of reloading it, should make the test suite run faster

This commit is contained in:
Jörn Zaefferer 2006-09-05 17:58:22 +00:00
parent 00e6e81f94
commit b5220adbbc
2 changed files with 22 additions and 12 deletions

View file

@ -1,18 +1,13 @@
var queue = [];
var blocking = false;
var fixture;
function reset() {
synchronize(function() {
blocking = true;
$.get('index.html', function(content) {
var div = $(document.createElement('div')).html(content)
// search for main div
.find('[@id=main]').html();
$('#main').html(div);
blocking = false;
process();
});
});
if(fixture) {
$("#main").html(fixture);
} else {
fixture = $("#main").html();
}
}
function synchronize(callback) {
@ -31,10 +26,11 @@ function process() {
}
function runTests(files) {
var fixture = null;
reset();
var startTime = new Date();
for( var i=0; i < files.length; i++) {
runTest( files, i );
reset();
}
synchronize(function() {
var runTime = new Date() - startTime;
@ -91,6 +87,7 @@ function runTest( files, num ) {
document.getElementById("tests").appendChild( li );
Test = [];
reset();
blocking = false;
process();
});