Mozilla/mozilla/webtools/litmus/js/TestRunCoverage.js
ccooper%deadsquid.com 65f9d98907 b=314938,321116,321388,322949,350251,370211,370212
* test runs:
** update coverage stats dynamically when returning to run more tests
** replace index page with test run summary statistics
** provide more guidance to users after they submit test results
** considerable page load speed increases at entry points to testing by pushing stats calculations into AJAX which will load after the page loads
** basic test run reporting


git-svn-id: svn://10.0.0.236/trunk@224673 18797224-902f-48f8-a5cc-f745e15eee43
2007-04-18 01:57:45 +00:00

30 lines
926 B
JavaScript

var coverageCells;
function beginCoverageLookup() {
coverageCells = document.getElementsByClassName('coverage');
getCoverage();
}
function getCoverage() {
var coverageCell = coverageCells.shift();
if (coverageCell) {
var test_run_id = coverageCell.id.match(/\d+/);
var url = 'json.cgi?coverage=1&test_run_id=' + test_run_id;
fetchJSON(url,updateCoverage,1);
}
}
function updateCoverage(data) {
test_run=data;
var coverageCell = document.getElementById('coverage_'+test_run.test_run_id);
if (coverageCell) {
if (test_run.coverage == 100) {
coverageCell.setAttribute('class','coverage-complete');
}
coverageCell.innerHTML = '<a href="test_run_report.cgi?test_run_id=' +
test_run.test_run_id + '">' +
test_run.coverage + '%</a>';
}
getCoverage();
}