OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 html { | 3 html { |
4 height: 100%; | 4 height: 100%; |
5 } | 5 } |
6 body { | 6 body { |
7 margin: 0; | 7 margin: 0; |
8 font-family: Helvetica, sans-serif; | 8 font-family: Helvetica, sans-serif; |
9 font-size: 11pt; | 9 font-size: 11pt; |
10 display: -webkit-flex; | 10 display: -webkit-flex; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 background-color:rgb(0,255,0); | 49 background-color:rgb(0,255,0); |
50 } | 50 } |
51 | 51 |
52 .test-fail { | 52 .test-fail { |
53 background-color:rgb(255,0,0); | 53 background-color:rgb(255,0,0); |
54 } | 54 } |
55 | 55 |
56 .test-skip { | 56 .test-skip { |
57 background-color:rgb(255,255,255); | 57 background-color:rgb(255,255,255); |
58 } | 58 } |
| 59 .test-run { |
| 60 background-color:rgb(255,252,108); |
| 61 } |
| 62 .log { |
| 63 font-family: "Courier New" |
| 64 } |
| 65 .stdio-href { |
| 66 color: grey; |
| 67 font-weight: bold; |
| 68 text-decoration: underline; |
| 69 } |
| 70 .stdio-href:hover { |
| 71 color:black; |
| 72 } |
59 </style> | 73 </style> |
60 <script> | 74 <script> |
61 var g_state; | 75 var g_state; |
62 function globalState() | 76 function globalState() |
63 { | 77 { |
64 if (!g_state) { | 78 if (!g_state) { |
65 g_state = { | 79 g_state = { |
66 results: {} | 80 results: {} |
67 } | 81 } |
68 } | 82 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 if(selected.checked) { | 144 if(selected.checked) { |
131 var test = table.rows[i].cells[1].innerHTML; | 145 var test = table.rows[i].cells[1].innerHTML; |
132 tests_list.tests.push(test); | 146 tests_list.tests.push(test); |
133 } | 147 } |
134 } | 148 } |
135 return tests_list; | 149 return tests_list; |
136 } | 150 } |
137 function rerun() | 151 function rerun() |
138 { | 152 { |
139 var log = document.getElementById('log'); | 153 var log = document.getElementById('log'); |
140 log.innerHTML = 'Re running tests again'; | 154 var testList = JSON.stringify(getTests()); |
141 var testList = getTests() | 155 var logText = document.createElement('p'); |
| 156 logText.innerHTML = 'Re running the tests'; |
| 157 logText.className = 'test-run'; |
| 158 var stdioIframe = document.createElement("IFRAME"); |
| 159 stdioIframe.style.display = 'none'; |
| 160 stdioIframe.width = window.innerWidth; |
| 161 stdioIframe.onload = function () { |
| 162 stdioIframe.contentWindow.scrollTo(0,stdioIframe.contentWindow.docum
ent.body.scrollHeight); |
| 163 } |
| 164 var stdio = document.createElement("a"); |
| 165 stdio.innerHTML = '<p>stdio<p>'; |
| 166 stdio.className = 'stdio-href'; |
| 167 stdio.onclick = function() { |
| 168 if(stdioIframe.style.display == 'none') |
| 169 stdioIframe.style.display = 'block'; |
| 170 else |
| 171 stdioIframe.style.display = 'none'; |
| 172 |
| 173 }; |
| 174 log.appendChild(logText); |
| 175 log.appendChild(stdio); |
| 176 log.appendChild(stdioIframe); |
142 if (testList == '') | 177 if (testList == '') |
143 alert('Please select atlest one Test'); | 178 alert('Please select atlest one Test'); |
144 else { | 179 else { |
145 xmlhttp = new XMLHttpRequest(); | 180 xmlhttp = new XMLHttpRequest(); |
146 var url ='http://localhost:9630/'; | 181 var url ='http://localhost:9630/'; |
147 xmlhttp.open('POST', url, true); | 182 xmlhttp.open('POST', url, true); |
148 xmlhttp.onerror = function() { | 183 xmlhttp.onerror = function() { |
| 184 logText.innerHTML = 'Please run the server using "webkit-patch layou
t-test-server"'; |
| 185 logText.className = 'test-fail'; |
149 alert('Server offline'); | 186 alert('Server offline'); |
150 } | 187 } |
151 xmlhttp.setRequestHeader("Content-type", "application/json"); | 188 xmlhttp.setRequestHeader("Content-type", "application/json"); |
152 xmlhttp.onreadystatechange = function() { | 189 xmlhttp.onreadystatechange = function() { |
153 if(xmlhttp.readyState > 0) | 190 if(xmlhttp.readyState > 0) { |
154 document.body.innerHTML = xmlhttp.responseText; | 191 stdioIframe.srcdoc = xmlhttp.responseText; |
| 192 } |
| 193 if(xmlhttp.readyState == 4) { |
| 194 logText.innerHTML = 'Tests Re-run done Reloading this page'; |
| 195 logText.className = 'test-pass'; |
| 196 location.reload(); |
| 197 } |
155 } | 198 } |
156 xmlhttp.send(JSON.stringify(getTests())); | 199 xmlhttp.send(testList); |
157 } | 200 } |
158 } | 201 } |
159 function checkalltests() | 202 function checkalltests() |
160 { | 203 { |
161 var value = document.getElementById("check_all").checked; | 204 var value = document.getElementById("check_all").checked; |
162 var table = document.getElementById("results-table"); | 205 var table = document.getElementById("results-table"); |
163 var length = table.rows.length; | 206 var length = table.rows.length; |
164 for (var i = 1; i < length; i++) { | 207 for (var i = 1; i < length; i++) { |
165 var checkbox = table.rows[i].cells[0].getElementsByTagName("input")[0]; | 208 var checkbox = table.rows[i].cells[0].getElementsByTagName("input")[0]; |
166 checkbox.checked = value; | 209 checkbox.checked = value; |
(...skipping 14 matching lines...) Expand all Loading... |
181 document.body.innerHTML += tableHeader; | 224 document.body.innerHTML += tableHeader; |
182 document.body.innerHTML += '</table></div>'; | 225 document.body.innerHTML += '</table></div>'; |
183 | 226 |
184 forEachTest(processGlobalStateFor); | 227 forEachTest(processGlobalStateFor); |
185 } | 228 } |
186 </script> | 229 </script> |
187 <!-- To run the tests --> | 230 <!-- To run the tests --> |
188 <script src="resources/archived-results-dashboard-test.js"></script> | 231 <script src="resources/archived-results-dashboard-test.js"></script> |
189 <body onload="generatePage()"> | 232 <body onload="generatePage()"> |
190 <h1>Dashboard</h1> | 233 <h1>Dashboard</h1> |
191 <p id=log></p> | 234 <div id=log class="log"></div> |
192 <p><button onclick="rerun()">Re Run Tests</button></p> | 235 <p><button onclick="rerun()">Re Run Tests</button></p> |
193 </body> | 236 </body> |
194 </html> | 237 </html> |
OLD | NEW |