Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: LayoutTests/fast/harness/archived-results-dashboard.html

Issue 502953003: Added support for re-running of layout tests form the dashboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing Failures Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/harness/resources/archived-results-dashboard-test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/harness/archived-results-dashboard.html
diff --git a/LayoutTests/fast/harness/archived-results-dashboard.html b/LayoutTests/fast/harness/archived-results-dashboard.html
index eec1e58500c9e4ee4eed121b9ca574e69f9f0cf1..af1e6b4582594cff19da6aba2be868e184e677ee 100644
--- a/LayoutTests/fast/harness/archived-results-dashboard.html
+++ b/LayoutTests/fast/harness/archived-results-dashboard.html
@@ -80,6 +80,10 @@ function processGlobalStateFor(testObject)
{
var table = document.getElementById('results-table');
var row = table.insertRow(-1);
+ var checkboxcell = row.insertCell(-1);
+ var checkbox = document.createElement("input");
+ checkbox.setAttribute('type','checkbox');
+ checkboxcell.appendChild(checkbox);
var cell = row.insertCell(-1);
cell.innerHTML = testObject.name;
for (var result in testObject.archived_results) {
@@ -114,10 +118,61 @@ function forEachTest(handler, opt_tree, opt_prefix)
forEachTest(handler, tree[key], newPrefix);
}
}
+function getTests()
+{
+ var table = document.getElementById('results-table');
+ var testCount = table.rows.length;
+ //FIXME : CONVERT TO JSON
+ var tests_list = '';
+ for(var i = 1; i < testCount; i++) {
+ var selected = table.rows[i].cells[0].getElementsByTagName("input")[0];
+ if(selected.checked) {
+ var test = table.rows[i].cells[1].innerHTML;
+ tests_list += test + ' ' ;
+ }
+ }
+ return tests_list;
+}
+function rerun()
+{
+ var log = document.getElementById('log');
+ log.innerHTML = 'Re running tests again';
+ var testList = getTests()
+ if (testList == '')
+ alert('Please select atlest one Test');
+ else {
+ xmlhttp = new XMLHttpRequest();
+ var url ='http://localhost:9630/';
+ xmlhttp.open('POST', url, true);
+ xmlhttp.onerror = function() {
+ alert('Server offline');
+ }
+ xmlhttp.setRequestHeader("Content-type", "application/json");
+ xmlhttp.onreadystatechange = function() {
+ if(xmlhttp.readyState > 0)
+ document.body.innerHTML = xmlhttp.responseText;
+ }
+ xmlhttp.send(String(getTests()));
+ }
+}
+function checkalltests()
+{
+ var value = document.getElementById("check_all").checked;
+ var table = document.getElementById("results-table");
+ var length = table.rows.length;
+ for (var i = 1; i < length; i++) {
+ var checkbox = table.rows[i].cells[0].getElementsByTagName("input")[0];
+ checkbox.checked = value;
+ }
+
+}
+
function generatePage()
{
var count = globalState().results.result_links.length;
- var tableHeader= '<div><table id= results-table><thead><tr>' +
+ var tableHeader= '<div><table id=results-table><thead><tr>' +
+ '<th>' + '<input type="checkbox" name="checkall" id="check_all" onclick="checkalltests()"></input>' + ' Rerun' + '</th>' +
+
'<th>Failing Tests ( Latest &#8594; Oldest )</th>';
for( var i = 0; i < count; i++)
tableHeader += '<th>'+ (i+1) +'</th>';
@@ -130,5 +185,9 @@ function generatePage()
</script>
<!-- To run the tests -->
<script src="resources/archived-results-dashboard-test.js"></script>
-<body onload="generatePage()"><h1>Dashboard</h1></body>
+<body onload="generatePage()">
+ <h1>Dashboard</h1>
+ <p id=log></p>
+ <p><button onclick="rerun()">Re Run Tests</button></p>
+</body>
</html>
« no previous file with comments | « no previous file | LayoutTests/fast/harness/resources/archived-results-dashboard-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698