OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 html { |
| 4 height: 100%; |
| 5 } |
| 6 body { |
| 7 margin: 0; |
| 8 font-family: Helvetica, sans-serif; |
| 9 font-size: 11pt; |
| 10 display: -webkit-flex; |
| 11 -webkit-flex-direction: column; |
| 12 height: 100%; |
| 13 } |
| 14 |
| 15 body > * { |
| 16 margin-left: 4px; |
| 17 margin-top: 4px; |
| 18 } |
| 19 |
| 20 h1 { |
| 21 font-size: 14pt; |
| 22 margin-top: 1.5em; |
| 23 text-align: center; |
| 24 text-decoration: underline; |
| 25 } |
| 26 |
| 27 a { |
| 28 text-decoration: none; |
| 29 } |
| 30 |
| 31 tr { |
| 32 background-color: white; |
| 33 } |
| 34 |
| 35 tr:hover { |
| 36 background-color: #999999; |
| 37 } |
| 38 |
| 39 td { |
| 40 padding: 1px 4px; |
| 41 valign: center; |
| 42 } |
| 43 |
| 44 td:hover .note{ |
| 45 display: block; |
| 46 } |
| 47 |
| 48 .test-pass { |
| 49 background-color:rgb(0,255,0); |
| 50 } |
| 51 |
| 52 .test-fail { |
| 53 background-color:rgb(255,0,0); |
| 54 } |
| 55 |
| 56 .test-skip { |
| 57 background-color:rgb(255,255,255); |
| 58 } |
| 59 </style> |
| 60 <script> |
| 61 var g_state; |
| 62 function globalState() |
| 63 { |
| 64 if (!g_state) { |
| 65 g_state = { |
| 66 results: {} |
| 67 } |
| 68 } |
| 69 return g_state; |
| 70 } |
| 71 |
| 72 function ADD_RESULTS(input) |
| 73 { |
| 74 globalState().results = input; |
| 75 } |
| 76 </script> |
| 77 <script src="archived_results.json"></script> |
| 78 <script> |
| 79 function processGlobalStateFor(testObject) |
| 80 { |
| 81 var table = document.getElementById('results-table'); |
| 82 var row = table.insertRow(-1); |
| 83 var cell = row.insertCell(-1); |
| 84 cell.innerHTML = testObject.name; |
| 85 for (var result in testObject.archived_results) { |
| 86 var res = testObject.archived_results[result]; |
| 87 var cell = row.insertCell(-1); |
| 88 if( res == 'PASS') |
| 89 cell.className = 'test-pass'; |
| 90 else if( res == 'SKIP') |
| 91 cell.className = 'test-skip'; |
| 92 else |
| 93 cell.className = 'test-fail'; |
| 94 var hrefElement = document.createElement("a"); |
| 95 hrefElement.href = globalState().results.result_links[result]; |
| 96 hrefElement.innerHTML = ' '; |
| 97 cell.appendChild(hrefElement); |
| 98 } |
| 99 |
| 100 |
| 101 } |
| 102 function forEachTest(handler, opt_tree, opt_prefix) |
| 103 { |
| 104 var tree = opt_tree || globalState().results.tests; |
| 105 var prefix = opt_prefix || ''; |
| 106 |
| 107 for (var key in tree) { |
| 108 var newPrefix = prefix ? (prefix + '/' + key) : key; |
| 109 if ('archived_results' in tree[key]) { |
| 110 var testObject = tree[key]; |
| 111 testObject.name = newPrefix; |
| 112 handler(testObject); |
| 113 } else |
| 114 forEachTest(handler, tree[key], newPrefix); |
| 115 } |
| 116 } |
| 117 function generatePage() |
| 118 { |
| 119 var count = globalState().results.result_links.length; |
| 120 var tableHeader= '<div><table id= results-table><thead><tr>' + |
| 121 '<th>Failing Tests ( Latest → Oldest )</th>'; |
| 122 for( var i = 0; i < count; i++) |
| 123 tableHeader += '<th>'+ (i+1) +'</th>'; |
| 124 tableHeader += '</thead>'; |
| 125 document.body.innerHTML += tableHeader; |
| 126 document.body.innerHTML += '</table></div>'; |
| 127 |
| 128 forEachTest(processGlobalStateFor); |
| 129 } |
| 130 </script> |
| 131 <!-- To run the tests --> |
| 132 <script src="resources/archived-results-dashboard-test.js"></script> |
| 133 <body onload="generatePage()"><h1>Dashboard</h1></body> |
| 134 </html> |
OLD | NEW |