From 8509f35243b5a09138e411ce8e0dbbe6edb49d90 Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Wed, 24 Sep 2008 17:15:39 -0700 Subject: [PATCH] Backed out changeset fa432b23baa5. (Backing out bug 454781 to investigate mochitest leaks) --- testing/mochitest/harness-overlay.xul | 9 +++- testing/mochitest/server.js | 46 ++++++------------- .../mochitest/tests/SimpleTest/TestRunner.js | 15 +++--- 3 files changed, 29 insertions(+), 41 deletions(-) diff --git a/testing/mochitest/harness-overlay.xul b/testing/mochitest/harness-overlay.xul index 4b2eab62fd5e..70846c157ba9 100644 --- a/testing/mochitest/harness-overlay.xul +++ b/testing/mochitest/harness-overlay.xul @@ -46,8 +46,11 @@ srvScope.makeTags(); var url = "chrome://mochikit/content/" + dir + "/"; var [links, count] = srvScope.list(url, chromeDir, true); - var tableContent = srvScope.linksToTableRows(links, 0); + var listContent = srvScope.linksToListItems(links); + var tableContent = srvScope.linksToTableRows(links); function populate() { + $("list-holder").setAttribute("rowspan", 1 + count); + $("test-list").innerHTML += listContent; $("test-table").innerHTML += tableContent; $("wrapper").innerHTML += " "; // redraw the table } @@ -96,7 +99,9 @@ Passed Failed Todo - Test Files + + + diff --git a/testing/mochitest/server.js b/testing/mochitest/server.js index a0f0f6b9e97d..47e4537025a9 100644 --- a/testing/mochitest/server.js +++ b/testing/mochitest/server.js @@ -399,45 +399,20 @@ function linksToListItems(links) /** * Transform nested hashtables of paths to a flat table rows. */ -function linksToTableRows(links, recursionLevel) +function linksToTableRows(links) { var response = ""; for (var [link, value] in links) { var classVal = (!isTest(link) && !(value instanceof Object)) ? "non-test invisible" : ""; - - spacer = "padding-left: " + (10 * recursionLevel) + "px"; - if (value instanceof Object) { response += TR({class: "dir", id: "tr-" + link }, - TD({colspan: "3"}, " "), - TD({style: spacer}, - A({href: link}, link))); - response += linksToTableRows(value, recursionLevel + 1); + TD({colspan: "3"}," ")); + response += linksToTableRows(value); } else { - var bug_title = link.match(/test_bug\S+/); - var bug_num = null; - if (bug_title != null) { - bug_num = bug_title[0].match(/\d+/); - } - if ((bug_title == null) || (bug_num == null)) { - response += TR({class: classVal, id: "tr-" + link }, - TD("0"), - TD("0"), - TD("0"), - TD({style: spacer}, - A({href: link}, link))); - } else { - var bug_url = "https://bugzilla.mozilla.org/show_bug.cgi?id=" + bug_num; - response += TR({class: classVal, id: "tr-" + link }, - TD("0"), - TD("0"), - TD("0"), - TD({style: spacer}, - A({href: link}, link), " - ", - A({href: bug_url}, "Bug " + bug_num))); - } + response += TR({class: classVal, id: "tr-" + link}, + TD("0"), TD("0"), TD("0")); } } return response; @@ -549,8 +524,15 @@ function testListing(metadata, response) ), TABLE({cellpadding: 0, cellspacing: 0, id: "test-table"}, - TR(TD("Passed"), TD("Failed"), TD("Todo"), TD("Test Files")), - linksToTableRows(links, 0) + TR(TD("Passed"), TD("Failed"), TD("Todo"), + TD({rowspan: count+1}, + UL({class: "top"}, + LI(B("Test Files")), + linksToListItems(links) + ) + ) + ), + linksToTableRows(links) ), DIV({class: "clear"}) ) diff --git a/testing/mochitest/tests/SimpleTest/TestRunner.js b/testing/mochitest/tests/SimpleTest/TestRunner.js index 2a00fd7b225b..66bccb15fe85 100644 --- a/testing/mochitest/tests/SimpleTest/TestRunner.js +++ b/testing/mochitest/tests/SimpleTest/TestRunner.js @@ -197,11 +197,12 @@ TestRunner.updateUI = function() { // Set the table values var trID = "tr-" + $('current-test-path').innerHTML; var row = $(trID); - var tds = row.getElementsByTagName("td"); - tds[0].style.backgroundColor = results.notOK > 0 ? "#f00" : "#0d0"; - tds[0].textContent = results.OK; - tds[1].style.backgroundColor = results.notOK > 0 ? "#f00" : "#0d0"; - tds[1].textContent = results.notOK; - tds[2].style.backgroundColor = results.todo > 0 ? "orange" : "#0d0"; - tds[2].textContent = results.todo; + replaceChildNodes(row, + TD({'style': + {'backgroundColor': results.notOK > 0 ? "#f00":"#0d0"}}, results.OK), + TD({'style': + {'backgroundColor': results.notOK > 0 ? "#f00":"#0d0"}}, results.notOK), + TD({'style': {'backgroundColor': + results.todo > 0 ? "orange":"#0d0"}}, results.todo) + ); }