10 font-family: Helvetica, sans-serif;
12 display: -webkit-flex;
13 -webkit-flex-direction: column;
29 text-decoration: none;
38 background: rgb(
200,
200,
200);
44 vertical-align: middle;
47 border:
1px solid rgb(
200,
200,
200);
52 border:
2px solid rgb(
128,
128,
128);
62 input[type=checkbox] {
69 background: rgb(
66,
184,
221);
73 text-shadow:
0 1px
2px rgba(
0,
0,
0,
0.2);
78 background: rgb(
80,
200,
250);
81 .result-cell, .test-pass, .test-fail, .test-skip, .test-run{
87 background-color: rgb(
143,
223,
95);
91 background-color: rgb(
233,
128,
128);
95 background-color: rgb(
255,
255,
255);
99 background-color: rgb(
255,
252,
108);
103 font-family:
"Courier New";
111 text-decoration: underline;
119 background: rgb(
66,
184,
221);
123 background: rgb(
200,
200,
200);
136 color: rgb(
104,
104,
104);
147 function globalState()
157 function ADD_RESULTS(input
)
159 globalState().results
= input
;
162 <script src=
"archived_results.json"></script>
164 function processGlobalStateFor(testObject
)
166 var table
= document
.getElementById('results-table');
167 var row
= table
.insertRow(-1);
168 if (table
.rows
.length
% 2 == 0)
169 row
.className
= 'even-row';
171 row
.className
= 'odd-row';
172 var checkboxcell
= row
.insertCell(-1);
173 var checkbox
= document
.createElement("input");
174 checkbox
.setAttribute('type','checkbox');
175 checkboxcell
.appendChild(checkbox
);
176 var cell
= row
.insertCell(-1);
177 cell
.innerHTML
= testObject
.name
;
178 for (var result
in testObject
.archived_results
) {
179 var res
= testObject
.archived_results
[result
];
180 var cell
= row
.insertCell(-1);
182 cell
.className
= 'test-pass';
183 else if( res
== 'SKIP')
184 cell
.className
= 'test-skip';
186 cell
.className
= 'test-fail';
187 var hrefElement
= document
.createElement("a");
188 hrefElement
.href
= globalState().results
.result_links
[result
];
189 hrefElement
.innerHTML
= ' ';
190 cell
.appendChild(hrefElement
);
195 function forEachTest(handler
, opt_tree
, opt_prefix
)
197 var tree
= opt_tree
|| globalState().results
.tests
;
198 var prefix
= opt_prefix
|| '';
200 for (var key
in tree
) {
201 var newPrefix
= prefix
? (prefix
+ '/' + key
) : key
;
202 if ('archived_results' in tree
[key
]) {
203 var testObject
= tree
[key
];
204 testObject
.name
= newPrefix
;
207 forEachTest(handler
, tree
[key
], newPrefix
);
212 var table
= document
.getElementById('results-table');
213 var testCount
= table
.rows
.length
;
217 for(var i
= 2; i
< testCount
; i
++) {
218 var selected
= table
.rows
[i
].cells
[0].getElementsByTagName("input")[0];
219 if(selected
.checked
) {
220 var test
= table
.rows
[i
].cells
[1].innerHTML
;
221 tests_list
.tests
.push(test
);
228 var log
= document
.getElementById('log');
229 var testList
= JSON
.stringify(getTests());
230 var logText
= document
.createElement('p');
231 logText
.innerHTML
= 'Re running the tests';
232 logText
.className
= 'test-run';
233 var stdioIframe
= document
.createElement("IFRAME");
234 stdioIframe
.style
.display
= 'none';
235 stdioIframe
.width
= window
.innerWidth
;
236 stdioIframe
.height
= '100px';
237 stdioIframe
.onload = function () {
238 stdioIframe
.contentWindow
.scrollTo(0,stdioIframe
.contentWindow
.document
.scrollingElement
.scrollHeight
);
240 var stdio
= document
.createElement("a");
241 stdio
.innerHTML
= '<p>stdio<p>';
242 stdio
.className
= 'stdio-href';
243 stdio
.onclick = function() {
244 if(stdioIframe
.style
.display
== 'none')
245 stdioIframe
.style
.display
= 'block';
247 stdioIframe
.style
.display
= 'none';
250 log
.appendChild(logText
);
251 log
.appendChild(stdio
);
252 log
.appendChild(stdioIframe
);
254 alert('Please select atlest one Test');
256 xmlhttp
= new XMLHttpRequest();
257 var url
='http://localhost:9630/';
258 xmlhttp
.open('POST', url
, true);
259 xmlhttp
.onerror = function() {
260 logText
.innerHTML
= 'Please run the server using "webkit-patch layout-test-server"';
261 logText
.className
= 'test-fail';
262 alert('Server offline');
264 xmlhttp
.setRequestHeader("Content-type", "application/json");
265 xmlhttp
.onreadystatechange = function() {
266 if(xmlhttp
.readyState
> 0) {
267 stdioIframe
.srcdoc
= xmlhttp
.responseText
;
269 if(xmlhttp
.readyState
== 4) {
270 logText
.innerHTML
= 'Tests Re-run done Reloading this page';
271 logText
.className
= 'test-pass';
275 xmlhttp
.send(testList
);
278 function checkalltests()
280 var value
= document
.getElementById("check_all").checked
;
281 var table
= document
.getElementById("results-table");
282 var length
= table
.rows
.length
;
283 for (var i
= 2; i
< length
; i
++) {
284 var checkbox
= table
.rows
[i
].cells
[0].getElementsByTagName("input")[0];
285 var disabled
= checkbox
.disabled
;
287 checkbox
.checked
= value
;
292 function searchTable(filterExp
)
294 var table
= document
.getElementById('results-table');
295 var testCount
= table
.rows
.length
;
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
);
305 table
.rows
[i
].style
.display
= 'none';
306 checkbox
.checked
= false;
307 checkbox
.disabled
= true;
310 table
.rows
[i
].style
.display
= '';
311 checkbox
.disabled
= false;
317 function applyfilter()
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
= '';
327 var totalCount
= document
.getElementById('results-table').rows
.length
- 2;
328 searchCount
.innerHTML
= count
+ '/' + totalCount
;
331 function createTableHeader()
333 var count
= globalState().results
.result_links
.length
;
334 var tableHeader
= '<table id=results-table><thead><tr>' +
336 '<input type="checkbox" name="checkall" id="check_all" onclick="checkalltests()"></input>' +
338 '<th rowspan="2" text-align:left;>Tests</th>' +
339 '<th colspan= '+ count
+'>Latest → 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
;
346 function generatePage()
349 forEachTest(processGlobalStateFor
);
353 <!-- To run the tests -->
354 <script src=
"resources/archived-results-dashboard-test.js"></script>
355 <body onload=
"generatePage()">
357 <div id=log
class=
"log"></div>
358 <div class=
"toolbox">
359 <button onclick=rerun()
class=
"rerun-button">Re Run Tests
</button>
360 <input type=
"text" id=applyfilter
oninput=
"applyfilter()" placeholder=
"Search via regular expression"></input>
361 <span id=searchcount
></span>