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

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

Issue 635413003: Added support for search filters in dashboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <style> 2 <style>
3
3 html { 4 html {
4 height: 100%; 5 height: 100%;
5 } 6 }
7
6 body { 8 body {
7 margin: 0; 9 margin: 1.0em;
8 font-family: Helvetica, sans-serif; 10 font-family: Helvetica, sans-serif;
9 font-size: 11pt; 11 font-size: 11pt;
10 display: -webkit-flex; 12 display: -webkit-flex;
11 -webkit-flex-direction: column; 13 -webkit-flex-direction: column;
12 height: 100%; 14 height: 100%;
13 } 15 }
14 16
15 body > * { 17 body > * {
16 margin-left: 4px; 18 margin-left: 4px;
17 margin-top: 4px; 19 margin-top: 4px;
18 } 20 }
19 21
20 h1 { 22 h1 {
21 font-size: 14pt; 23 font-size: 150%;
22 margin-top: 1.5em; 24 margin-top: 1.5em;
23 text-align: center; 25 text-align: center;
24 text-decoration: underline;
25 } 26 }
26 27
27 a { 28 a {
28 text-decoration: none; 29 text-decoration: none;
29 } 30 }
30 31
31 tr { 32 table {
32 background-color: white; 33 position: relative;
34 top: 100px;
33 } 35 }
34 36
35 tr:hover { 37 th {
36 background-color: #999999; 38 background: rgb(200, 200, 200);
39 border-radius: 5px;
37 } 40 }
38 41
39 td { 42 td {
40 padding: 1px 4px; 43 padding: 1px 4px;
41 valign: center; 44 vertical-align: middle;
45 min-width: 20px;
46 height: 25px;
47 border: 1px solid rgb(200, 200, 200);
48 border-radius: 5px;
42 } 49 }
43 50
44 td:hover .note{ 51 input[type=text] {
45 display: block; 52 border: 2px solid rgb(128, 128, 128);
53 font-size: 120%;
54 height: 30px;
55 margin-bottom: 1.0em;
56 margin-top: 1.0em;
57 margin-left: 1.0em;
58 padding-left: 0.8em;
59 width: 500px;
60 }
61
62 input[type=checkbox] {
63 padding: 0.1em;
64 width: 20px;
65 height: 20px;
66 }
67
68 .rerun-button {
69 background: rgb(66, 184, 221);
70 border-radius: 5px;
71 font-size: 120%;
72 height: 40px;
73 text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
74 width: 150px;
75 }
76
77 .rerun-button:hover {
78 background: rgb(80, 200, 250);
79 }
80
81 .result-cell, .test-pass, .test-fail, .test-skip, .test-run{
82 border: 0px;
83 border-radius: 5px;
46 } 84 }
47 85
48 .test-pass { 86 .test-pass {
49 background-color:rgb(0,255,0); 87 background-color: rgb(143, 223, 95);
50 } 88 }
51 89
52 .test-fail { 90 .test-fail {
53 background-color:rgb(255,0,0); 91 background-color: rgb(233, 128, 128);
54 } 92 }
55 93
56 .test-skip { 94 .test-skip {
57 background-color:rgb(255,255,255); 95 background-color: rgb(255, 255, 255);
58 } 96 }
97
59 .test-run { 98 .test-run {
60 background-color:rgb(255,252,108); 99 background-color: rgb(255, 252, 108);
61 } 100 }
101
62 .log { 102 .log {
63 font-family: "Courier New" 103 font-family: "Courier New";
104 display: block;
105 position: relative;
64 } 106 }
107
65 .stdio-href { 108 .stdio-href {
66 color: grey; 109 color: grey;
67 font-weight: bold; 110 font-weight: bold;
68 text-decoration: underline; 111 text-decoration: underline;
69 } 112 }
113
70 .stdio-href:hover { 114 .stdio-href:hover {
71 color:black; 115 color:black;
72 } 116 }
117
118 .odd-row {
119 background: rgb(66, 184, 221);
120 }
121
122 .even-row {
123 background: rgb(200, 200, 200);
124 }
125
126 .toolbox {
127 display: block;
128 position: fixed;
129 padding: 4px;
130 top: 10px;
131 right: 10px;
132 z-index: 9999;
133 }
134
135 .toolbox span {
136 color: rgb(104, 104, 104);
137 position: absolute;
138 text-align: right;
139 top: 30px;
140 left: 570px;
141 width: 100px;
142 }
143
73 </style> 144 </style>
74 <script> 145 <script>
75 var g_state; 146 var g_state;
76 function globalState() 147 function globalState()
77 { 148 {
78 if (!g_state) { 149 if (!g_state) {
79 g_state = { 150 g_state = {
80 results: {} 151 results: {}
81 } 152 }
82 } 153 }
83 return g_state; 154 return g_state;
84 } 155 }
85 156
86 function ADD_RESULTS(input) 157 function ADD_RESULTS(input)
87 { 158 {
88 globalState().results = input; 159 globalState().results = input;
89 } 160 }
90 </script> 161 </script>
91 <script src="archived_results.json"></script> 162 <script src="archived_results.json"></script>
92 <script> 163 <script>
93 function processGlobalStateFor(testObject) 164 function processGlobalStateFor(testObject)
94 { 165 {
95 var table = document.getElementById('results-table'); 166 var table = document.getElementById('results-table');
96 var row = table.insertRow(-1); 167 var row = table.insertRow(-1);
168 if (table.rows.length % 2 == 0)
169 row.className = 'even-row';
170 else
171 row.className = 'odd-row';
97 var checkboxcell = row.insertCell(-1); 172 var checkboxcell = row.insertCell(-1);
98 var checkbox = document.createElement("input"); 173 var checkbox = document.createElement("input");
99 checkbox.setAttribute('type','checkbox'); 174 checkbox.setAttribute('type','checkbox');
100 checkboxcell.appendChild(checkbox); 175 checkboxcell.appendChild(checkbox);
101 var cell = row.insertCell(-1); 176 var cell = row.insertCell(-1);
102 cell.innerHTML = testObject.name; 177 cell.innerHTML = testObject.name;
103 for (var result in testObject.archived_results) { 178 for (var result in testObject.archived_results) {
104 var res = testObject.archived_results[result]; 179 var res = testObject.archived_results[result];
105 var cell = row.insertCell(-1); 180 var cell = row.insertCell(-1);
106 if( res == 'PASS') 181 if( res == 'PASS')
107 cell.className = 'test-pass'; 182 cell.className = 'test-pass';
108 else if( res == 'SKIP') 183 else if( res == 'SKIP')
109 cell.className = 'test-skip'; 184 cell.className = 'test-skip';
110 else 185 else
111 cell.className = 'test-fail'; 186 cell.className = 'test-fail';
112 var hrefElement = document.createElement("a"); 187 var hrefElement = document.createElement("a");
113 hrefElement.href = globalState().results.result_links[result]; 188 hrefElement.href = globalState().results.result_links[result];
114 hrefElement.innerHTML = '&nbsp;&nbsp;'; 189 hrefElement.innerHTML = '&nbsp;&nbsp;&nbsp;&nbsp;';
115 cell.appendChild(hrefElement); 190 cell.appendChild(hrefElement);
116 } 191 }
117 192
118 193
119 } 194 }
120 function forEachTest(handler, opt_tree, opt_prefix) 195 function forEachTest(handler, opt_tree, opt_prefix)
121 { 196 {
122 var tree = opt_tree || globalState().results.tests; 197 var tree = opt_tree || globalState().results.tests;
123 var prefix = opt_prefix || ''; 198 var prefix = opt_prefix || '';
124 199
125 for (var key in tree) { 200 for (var key in tree) {
126 var newPrefix = prefix ? (prefix + '/' + key) : key; 201 var newPrefix = prefix ? (prefix + '/' + key) : key;
127 if ('archived_results' in tree[key]) { 202 if ('archived_results' in tree[key]) {
128 var testObject = tree[key]; 203 var testObject = tree[key];
129 testObject.name = newPrefix; 204 testObject.name = newPrefix;
130 handler(testObject); 205 handler(testObject);
131 } else 206 } else
132 forEachTest(handler, tree[key], newPrefix); 207 forEachTest(handler, tree[key], newPrefix);
133 } 208 }
134 } 209 }
135 function getTests() 210 function getTests()
136 { 211 {
137 var table = document.getElementById('results-table'); 212 var table = document.getElementById('results-table');
138 var testCount = table.rows.length; 213 var testCount = table.rows.length;
139 var tests_list = { 214 var tests_list = {
140 tests : [] 215 tests : []
141 }; 216 };
142 for(var i = 1; i < testCount; i++) { 217 for(var i = 2; i < testCount; i++) {
143 var selected = table.rows[i].cells[0].getElementsByTagName("input")[0]; 218 var selected = table.rows[i].cells[0].getElementsByTagName("input")[0];
144 if(selected.checked) { 219 if(selected.checked) {
145 var test = table.rows[i].cells[1].innerHTML; 220 var test = table.rows[i].cells[1].innerHTML;
146 tests_list.tests.push(test); 221 tests_list.tests.push(test);
147 } 222 }
148 } 223 }
149 return tests_list; 224 return tests_list;
150 } 225 }
151 function rerun() 226 function rerun()
152 { 227 {
153 var log = document.getElementById('log'); 228 var log = document.getElementById('log');
154 var testList = JSON.stringify(getTests()); 229 var testList = JSON.stringify(getTests());
155 var logText = document.createElement('p'); 230 var logText = document.createElement('p');
156 logText.innerHTML = 'Re running the tests'; 231 logText.innerHTML = 'Re running the tests';
157 logText.className = 'test-run'; 232 logText.className = 'test-run';
158 var stdioIframe = document.createElement("IFRAME"); 233 var stdioIframe = document.createElement("IFRAME");
159 stdioIframe.style.display = 'none'; 234 stdioIframe.style.display = 'none';
160 stdioIframe.width = window.innerWidth; 235 stdioIframe.width = window.innerWidth;
236 stdioIframe.height = '100px';
161 stdioIframe.onload = function () { 237 stdioIframe.onload = function () {
162 stdioIframe.contentWindow.scrollTo(0,stdioIframe.contentWindow.docum ent.body.scrollHeight); 238 stdioIframe.contentWindow.scrollTo(0,stdioIframe.contentWindow.docum ent.body.scrollHeight);
163 } 239 }
164 var stdio = document.createElement("a"); 240 var stdio = document.createElement("a");
165 stdio.innerHTML = '<p>stdio<p>'; 241 stdio.innerHTML = '<p>stdio<p>';
166 stdio.className = 'stdio-href'; 242 stdio.className = 'stdio-href';
167 stdio.onclick = function() { 243 stdio.onclick = function() {
168 if(stdioIframe.style.display == 'none') 244 if(stdioIframe.style.display == 'none')
169 stdioIframe.style.display = 'block'; 245 stdioIframe.style.display = 'block';
170 else 246 else
(...skipping 26 matching lines...) Expand all
197 } 273 }
198 } 274 }
199 xmlhttp.send(testList); 275 xmlhttp.send(testList);
200 } 276 }
201 } 277 }
202 function checkalltests() 278 function checkalltests()
203 { 279 {
204 var value = document.getElementById("check_all").checked; 280 var value = document.getElementById("check_all").checked;
205 var table = document.getElementById("results-table"); 281 var table = document.getElementById("results-table");
206 var length = table.rows.length; 282 var length = table.rows.length;
207 for (var i = 1; i < length; i++) { 283 for (var i = 2; i < length; i++) {
208 var checkbox = table.rows[i].cells[0].getElementsByTagName("input")[0]; 284 var checkbox = table.rows[i].cells[0].getElementsByTagName("input")[0];
285 var disabled = checkbox.disabled;
286 if(!disabled)
209 checkbox.checked = value; 287 checkbox.checked = value;
210 } 288 }
211 289
212 } 290 }
213 291
292 function searchTable(filterExp)
293 {
294 var table = document.getElementById('results-table');
295 var testCount = table.rows.length;
296 var tests_list = {
297 tests : []
298 };
299 var searchCount = 0;
300 for(var i = 2; i < testCount; i++) {
301 var cellContent = table.rows[i].cells[1].innerHTML;
302 var checkbox = table.rows[i].cells[0].getElementsByTagName("input")[0];
303 var index = cellContent.search(filterExp);
304 if (index < 0) {
305 table.rows[i].style.display = 'none';
306 checkbox.checked = false;
307 checkbox.disabled = true;
308 }
309 else {
310 table.rows[i].style.display = '';
311 checkbox.disabled = false;
312 searchCount += 1;
313 }
314 }
315 return searchCount;
316 }
317 function applyfilter()
318 {
319 var filterString = document.getElementById('applyfilter').value;
320 var searchCount = document.getElementById('searchcount');
321 var filterExp = new RegExp(filterString, "i");
322 var count = searchTable(filterExp);
323 if(filterString == '') {
324 searchCount.innerHTML = '';
325 return;
326 }
327 var totalCount = document.getElementById('results-table').rows.length - 2;
328 searchCount.innerHTML = count + '/' + totalCount;
329 }
330
331 function createTableHeader()
332 {
333 var count = globalState().results.result_links.length;
334 var tableHeader= '<table id=results-table><thead><tr>' +
335 '<th rowspan="2">' +
336 '<input type="checkbox" name="checkall" id="check_all" onclick="chec kalltests()"></input>' +
337 '</th>' +
338 '<th rowspan="2" text-align:left;>Tests</th>' +
339 '<th colspan= '+ count +'>Latest &#8594; Oldest</th> </tr><tr>';
340 for( var i = 0; i < count; i++)
341 tableHeader += '<th>'+ (i+1) +'</th>';
342 tableHeader += '</tr></thead></table>';
343 document.body.innerHTML += tableHeader;
344 }
345
214 function generatePage() 346 function generatePage()
215 { 347 {
216 var count = globalState().results.result_links.length; 348 createTableHeader();
217 var tableHeader= '<div><table id=results-table><thead><tr>' +
218 '<th>' + '<input type="checkbox" name="checkall" id="check_all" onclick= "checkalltests()"></input>' + ' Rerun' + '</th>' +
219
220 '<th>Failing Tests ( Latest &#8594; Oldest )</th>';
221 for( var i = 0; i < count; i++)
222 tableHeader += '<th>'+ (i+1) +'</th>';
223 tableHeader += '</thead>';
224 document.body.innerHTML += tableHeader;
225 document.body.innerHTML += '</table></div>';
226
227 forEachTest(processGlobalStateFor); 349 forEachTest(processGlobalStateFor);
228 } 350 }
351
229 </script> 352 </script>
230 <!-- To run the tests --> 353 <!-- To run the tests -->
231 <script src="resources/archived-results-dashboard-test.js"></script> 354 <script src="resources/archived-results-dashboard-test.js"></script>
232 <body onload="generatePage()"> 355 <body onload="generatePage()">
233 <h1>Dashboard</h1> 356 <h1>Dashboard</h1>
234 <div id=log class="log"></div> 357 <div id=log class="log"></div>
235 <p><button onclick="rerun()">Re Run Tests</button></p> 358 <div class="toolbox">
359 <button onclick=rerun() class="rerun-button">Re Run Tests</button>
360 <input type="text" id=applyfilter oninput="applyfilter()" placeholder="S earch via regular expression"></input>
361 <span id=searchcount></span>
362 </div>
236 </body> 363 </body>
237 </html> 364 </html>
OLDNEW
« 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