function getTestList(uri) { var xmlhttp = new XMLHttpRequest(); // xmlhttp.open("GET", "/css-validator/autotest/testsuite/xml/"+ // "bugs.xml",false); xmlhttp.open("GET", uri, false); xmlhttp.setRequestHeader('Cache-Control','no-cache') // xmlhttp.setRequestHeader('Accept','application/json') // xmlhttp.onreadystatechange=function() { // if (xmlhttp.readyState==4) { // checkResults(testrow, resultrow, xmlhttp); // } // } xmlhttp.send(null); generateTestTable(xmlhttp); } // generate the table with the first row // parameter the id of the table created // the table is as follow: // // // [0] // [1] // [2] (expected) // [3] (int) (FIXME or "-" ? ) (expected) // [4] (int, expected). // function createTableFromID(tableid) { var table = document.createElement("table"); table.setAttribute("id", tableid); table.setAttribute("border", "2"); var tbody = document.createElement("tbody"); var tr = document.createElement("tr"); // first row var cell = document.createElement("th"); var tnode = document.createTextNode("Test Case: "+tableid+" "); cell.appendChild(tnode); var anc = document.createElement("a"); anc.setAttribute("href", "javascript:checkTableTests('"+tableid+"')"); tnode = document.createTextNode("[check]"); anc.appendChild(tnode); cell.appendChild(anc); tnode = document.createTextNode(" "); cell.appendChild(tnode); anc = document.createElement("a"); anc.setAttribute("href", "javascript:resetresults('"+tableid+"')"); tnode = document.createTextNode("[reset]"); anc.appendChild(tnode); cell.appendChild(anc); tr.appendChild(cell); cell = document.createElement("th"); tnode = document.createTextNode("Profile"); cell.appendChild(tnode); tr.appendChild(cell); cell = document.createElement("th"); tnode = document.createTextNode("Validity"); cell.appendChild(tnode); tr.appendChild(cell); cell = document.createElement("th"); tnode = document.createTextNode("Errors"); cell.appendChild(tnode); tr.appendChild(cell); cell = document.createElement("th"); tnode = document.createTextNode("Warnings"); cell.appendChild(tnode); tr.appendChild(cell); tbody.appendChild(tr); table.appendChild(tbody); return table; } function generateLinkToTable(tableId) { var controldiv = document.getElementById("controldiv"); if (controldiv) { var divul = controldiv.getElementsByTagName("ul"); if (divul.length > 0) { divul = divul[0]; } else { divul = document.createElement("ul"); controldiv.appendChild(divul); } var li = document.createElement("li"); var anc = document.createElement("a"); anc.setAttribute("href", "#"+tableId); var tnode = document.createTextNode(tableId); anc.appendChild(tnode); li.appendChild(anc); divul.appendChild(li); } } function getTestTable(typetag) { var tableId = "default"; if (typetag) { tableId = typetag.getAttribute("title"); } var table = document.getElementById(tableId); if (!table) { table = createTableFromID(tableId); var tableanchor = document.getElementById("tableanchor"); tableanchor.appendChild(table); generateLinkToTable(tableId); } // and attach the newly created table at the right place var tbody = table.getElementsByTagName("tbody"); if (tbody) { return tbody[0]; } return null; } function generateTestTable(req) { var testxml = req.responseXML; var docuri = testxml.documentURI; if (!docuri) { docuri = testxml.URL; // damn Safari... } var allTypes = testxml.getElementsByTagName("type"); // for each get the table, find test // and add them for (var i=0; i // [0] // [1] // [2] // [3] // [4] // var tr = document.createElement("tr"); tr.setAttribute("class", "expected"); var cell = document.createElement("td"); cell.setAttribute("rowspan","2"); var anc = document.createElement("a"); anc.setAttribute("href",testfile); anc.setAttribute("medium", medium); anc.setAttribute("warning", warningLevel); var text = document.createTextNode("[Testcase]"); anc.appendChild(text); cell.appendChild(anc); text = document.createTextNode(" - "); cell.appendChild(text); anc = document.createElement("a"); var checkuri = validator_uri+"validator?uri="+ urlencode(testfile)+"&profile="+ cssprofile+"&usermedium="+medium+"&warning="+warningLevel; // FIXME medium, warning level anc.setAttribute("href",checkuri); text = document.createTextNode("[Result]"); anc.appendChild(text); cell.appendChild(anc); anc = document.createElement("p"); anc.innerHTML = testdesc; cell.appendChild(anc); tr.appendChild(cell); cell = document.createElement("td"); cell.setAttribute("rowspan","2"); text = document.createTextNode(cssprofile); cell.appendChild(text); tr.appendChild(cell); cell = document.createElement("td"); text = document.createTextNode(validity); cell.appendChild(text); tr.appendChild(cell); cell = document.createElement("td"); text = document.createTextNode(nberrors); cell.appendChild(text); tr.appendChild(cell); cell = document.createElement("td"); text = document.createTextNode(nbwarnings); cell.appendChild(text); tr.appendChild(cell); var result_row = getResultRow(); table.appendChild(result_row); table.insertBefore(tr,result_row); } } function getResultRow() { var tr = document.createElement("tr"); tr.setAttribute("class", "result"); var cell = document.createElement("td"); var text = document.createTextNode("-"); cell.appendChild(text); tr.appendChild(cell); cell = document.createElement("td"); text = document.createTextNode("-"); cell.appendChild(text); tr.appendChild(cell); cell = document.createElement("td"); text = document.createTextNode("-"); cell.appendChild(text); tr.appendChild(cell); return tr; }
Test CaseProfileValidityErrorsWarnings
// [Testcase] // [Results] //

description

//
profilevalidityerrorswarnings