OLD | NEW |
---|---|
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 | 3 |
4 <head> | 4 <head> |
5 <title>Webkit Layout Test History</title> | 5 <title>Webkit Layout Test History</title> |
6 <script> | 6 <script> |
7 var pageLoadStartTime = Date.now(); | 7 var pageLoadStartTime = Date.now(); |
8 </script> | 8 </script> |
9 <style> | 9 <style> |
10 body { | 10 body { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 console.log('Invalid key: ' + key + ' value: ' + value); | 262 console.log('Invalid key: ' + key + ' value: ' + value); |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 function appendScript(path) { | 266 function appendScript(path) { |
267 var script = document.createElement('script'); | 267 var script = document.createElement('script'); |
268 script.src = path; | 268 script.src = path; |
269 document.getElementsByTagName('head')[0].appendChild(script); | 269 document.getElementsByTagName('head')[0].appendChild(script); |
270 } | 270 } |
271 | 271 |
272 // Parse hash parameters. | |
273 // Permalinkable state of the page. | |
274 var currentState = {}; | |
272 | 275 |
273 // Parse query parameters. | 276 if (stringContains(window.location.hash, "debug=true")) { |
274 var queryState = {'debug': false, 'testType': 'layout_test_results'}; | |
275 | |
276 function handleValidQueryParameter(key, value) { | |
277 switch (key) { | |
278 case 'testType': | |
279 validateParameter(queryState, key, value, | |
280 function() { | |
281 return isValidName(value); | |
282 }); | |
283 | |
284 return true; | |
285 | |
286 case 'debug': | |
287 queryState[key] = value == 'true'; | |
288 | |
289 return true; | |
290 | |
291 default: | |
292 return false; | |
293 } | |
294 } | |
295 | |
296 parseParameters(window.location.search.substring(1), | |
297 handleValidQueryParameter); | |
298 if (queryState['debug']) { | |
299 // In debug mode point to the results.json and expectations.json in the | 277 // In debug mode point to the results.json and expectations.json in the |
300 // local tree. Useful for debugging changes to the python JSON generator. | 278 // local tree. Useful for debugging changes to the python JSON generator. |
301 var builders = {'DUMMY_BUILDER_NAME': ''}; | 279 var builders = {'DUMMY_BUILDER_NAME': ''}; |
302 var builderBase = '../../Debug/'; | 280 var builderBase = '../../Debug/'; |
303 queryState['testType'] = 'layout-test-results'; | 281 currentState['testType'] = 'layout-test-results'; |
304 } else { | 282 } else { |
305 // Map of builderName (the name shown in the waterfall) | 283 // Map of builderName (the name shown in the waterfall) |
306 // to builderPath (the path used in the builder's URL) | 284 // to builderPath (the path used in the builder's URL) |
307 // TODO(ojan): Make this switch based off of the testType. | 285 // TODO(ojan): Make this switch based off of the testType. |
308 var builders = { | 286 var builders = { |
309 'Webkit': 'webkit-rel', | 287 'Webkit': 'webkit-rel', |
310 'Webkit (dbg)(1)': 'webkit-dbg-1', | 288 'Webkit (dbg)(1)': 'webkit-dbg-1', |
311 'Webkit (dbg)(2)': 'webkit-dbg-2', | 289 'Webkit (dbg)(2)': 'webkit-dbg-2', |
312 'Webkit (dbg)(3)': 'webkit-dbg-3', | 290 'Webkit (dbg)(3)': 'webkit-dbg-3', |
313 'Webkit Linux': 'webkit-rel-linux', | 291 'Webkit Linux': 'webkit-rel-linux', |
314 'Webkit Linux (dbg)(1)': 'webkit-dbg-linux-1', | 292 'Webkit Linux (dbg)(1)': 'webkit-dbg-linux-1', |
315 'Webkit Linux (dbg)(2)': 'webkit-dbg-linux-2', | 293 'Webkit Linux (dbg)(2)': 'webkit-dbg-linux-2', |
316 'Webkit Linux (dbg)(3)': 'webkit-dbg-linux-3', | 294 'Webkit Linux (dbg)(3)': 'webkit-dbg-linux-3', |
317 'Webkit Mac10.5': 'webkit-rel-mac5', | 295 'Webkit Mac10.5': 'webkit-rel-mac5', |
318 'Webkit Mac10.5 (dbg)(1)': 'webkit-dbg-mac5-1', | 296 'Webkit Mac10.5 (dbg)(1)': 'webkit-dbg-mac5-1', |
319 'Webkit Mac10.5 (dbg)(2)': 'webkit-dbg-mac5-2', | 297 'Webkit Mac10.5 (dbg)(2)': 'webkit-dbg-mac5-2', |
320 'Webkit Mac10.5 (dbg)(3)': 'webkit-dbg-mac5-3' | 298 'Webkit Mac10.5 (dbg)(3)': 'webkit-dbg-mac5-3' |
321 }; | 299 }; |
322 var builderBase = 'http://build.chromium.org/buildbot/'; | 300 var builderBase = 'http://build.chromium.org/buildbot/'; |
323 } | 301 } |
324 | 302 |
325 // Parse hash parameters. | |
326 // Permalinkable state of the page. | |
327 var currentState = {}; | |
328 | |
329 var defaultStateValues = { | 303 var defaultStateValues = { |
330 sortOrder: BACKWARD, | 304 sortOrder: BACKWARD, |
331 sortColumn: 'flakiness', | 305 sortColumn: 'flakiness', |
332 showWontFix: false, | 306 showWontFix: false, |
333 showCorrectExpectations: false, | 307 showCorrectExpectations: false, |
334 showFlaky: true, | 308 showFlaky: true, |
335 maxResults: 200 | 309 maxResults: 200, |
310 testType: 'layout_test_results' | |
336 }; | 311 }; |
337 | 312 |
338 for (var builder in builders) { | 313 for (var builder in builders) { |
339 defaultStateValues.builder = builder; | 314 defaultStateValues.builder = builder; |
340 break; | 315 break; |
341 } | 316 } |
342 | 317 |
343 function fillDefaultStateValues() { | 318 function fillDefaultStateValues() { |
344 // tests has no states with default values. | 319 // tests has no states with default values. |
345 if (currentState.tests) | 320 if (currentState.tests) |
346 return; | 321 return; |
347 | 322 |
348 for (var state in defaultStateValues) { | 323 for (var state in defaultStateValues) { |
349 if (!(state in currentState)) | 324 if (!(state in currentState)) |
350 currentState[state] = defaultStateValues[state]; | 325 currentState[state] = defaultStateValues[state]; |
351 } | 326 } |
352 } | 327 } |
353 | 328 |
354 function handleValidHashParameter(key, value) { | 329 function handleValidHashParameter(key, value) { |
355 switch(key) { | 330 switch(key) { |
331 case 'testType': | |
332 validateParameter(currentState, key, value, | |
333 function() { | |
334 return isValidName(value); | |
335 }); | |
336 | |
337 return true; | |
338 | |
356 case 'tests': | 339 case 'tests': |
357 validateParameter(currentState, key, value, | 340 validateParameter(currentState, key, value, |
358 function() { | 341 function() { |
359 return isValidName(value); | 342 return isValidName(value); |
360 }); | 343 }); |
361 | 344 |
362 return true; | 345 return true; |
363 | 346 |
364 case 'builder': | 347 case 'builder': |
365 validateParameter(currentState, key, value, | 348 validateParameter(currentState, key, value, |
(...skipping 24 matching lines...) Expand all Loading... | |
390 return true; | 373 return true; |
391 | 374 |
392 case 'maxResults': | 375 case 'maxResults': |
393 validateParameter(currentState, key, value, | 376 validateParameter(currentState, key, value, |
394 function() { | 377 function() { |
395 return value.match(/^\d+$/) | 378 return value.match(/^\d+$/) |
396 }); | 379 }); |
397 | 380 |
398 return true; | 381 return true; |
399 | 382 |
383 case 'debug': | |
400 case 'showWontFix': | 384 case 'showWontFix': |
401 case 'showCorrectExpectations': | 385 case 'showCorrectExpectations': |
402 case 'showFlaky': | 386 case 'showFlaky': |
403 currentState[key] = value == 'true'; | 387 currentState[key] = value == 'true'; |
404 | 388 |
405 return true; | 389 return true; |
406 | 390 |
407 default: | 391 default: |
408 return false; | 392 return false; |
409 } | 393 } |
410 } | 394 } |
411 | 395 |
412 // Keep the location around for detecting changes to hash arguments | 396 // Keep the location around for detecting changes to hash arguments |
413 // manually typed into the URL bar. | 397 // manually typed into the URL bar. |
414 var oldLocation; | 398 var oldLocation; |
415 | 399 |
416 function parseAllParameters() { | 400 function parseAllParameters() { |
417 oldLocation = window.location.href; | 401 oldLocation = window.location.href; |
418 parseParameters(window.location.search.substring(1), | |
419 handleValidQueryParameter); | |
420 parseParameters(window.location.hash.substring(1), | 402 parseParameters(window.location.hash.substring(1), |
421 handleValidHashParameter); | 403 handleValidHashParameter); |
422 fillDefaultStateValues(); | 404 fillDefaultStateValues(); |
423 } | 405 } |
424 | 406 |
425 parseAllParameters(); | 407 parseAllParameters(); |
426 | 408 |
427 // Append JSON script elements. | 409 // Append JSON script elements. |
428 var resultsByBuilder = {}; | 410 var resultsByBuilder = {}; |
429 // Maps test path to an array of {builder, testResults} objects. | 411 // Maps test path to an array of {builder, testResults} objects. |
430 var testToResultsMap = {}; | 412 var testToResultsMap = {}; |
431 var expectationsByTest = {}; | 413 var expectationsByTest = {}; |
432 function ADD_RESULTS(builds) { | 414 function ADD_RESULTS(builds) { |
433 for (var builderName in builds) { | 415 for (var builderName in builds) { |
434 if (builderName != 'version') | 416 if (builderName != 'version') |
435 resultsByBuilder[builderName] = builds[builderName]; | 417 resultsByBuilder[builderName] = builds[builderName]; |
436 } | 418 } |
437 | 419 |
438 generatePage(); | 420 generatePage(); |
439 } | 421 } |
440 | 422 |
441 function getPathToBuilderResultsFile(builderName) { | 423 function getPathToBuilderResultsFile(builderName) { |
442 return builderBase + queryState['testType'] + '/' + | 424 return builderBase + currentState['testType'] + '/' + |
443 builders[builderName] + '/'; | 425 builders[builderName] + '/'; |
444 } | 426 } |
445 | 427 |
446 for (var builderName in builders) { | 428 for (var builderName in builders) { |
447 appendScript(getPathToBuilderResultsFile(builderName) + 'results.json'); | 429 appendScript(getPathToBuilderResultsFile(builderName) + 'results.json'); |
448 } | 430 } |
449 | 431 |
450 // Grab expectations file from any builder. | 432 // Grab expectations file from any builder. |
451 appendScript(getPathToBuilderResultsFile(builderName) + 'expectations.json'); | 433 appendScript(getPathToBuilderResultsFile(builderName) + 'expectations.json'); |
452 | 434 |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1205 | 1187 |
1206 var ths = document.getElementsByTagName('th'); | 1188 var ths = document.getElementsByTagName('th'); |
1207 for (var i = 0; i < ths.length; i++) { | 1189 for (var i = 0; i < ths.length; i++) { |
1208 ths[i].addEventListener('click', changeSort, false); | 1190 ths[i].addEventListener('click', changeSort, false); |
1209 ths[i].className = "sortable"; | 1191 ths[i].className = "sortable"; |
1210 } | 1192 } |
1211 | 1193 |
1212 $('max-results-input').value = currentState.maxResults; | 1194 $('max-results-input').value = currentState.maxResults; |
1213 } | 1195 } |
1214 | 1196 |
1197 var singleBuilderViewParameters = ['sortOrder', 'sortColumn', 'showWontFix', | |
1198 'showCorrectExpectations', 'showFlaky: true', 'maxResults']; | |
arv (Not doing code reviews)
2009/09/10 00:25:13
fix indentation
| |
1199 | |
1215 /** | 1200 /** |
1216 * Sets the page state and regenerates the page. Takes varargs of key, value | 1201 * Sets the page state and regenerates the page. Takes varargs of key, value |
1217 * pairs. | 1202 * pairs. |
1218 */ | 1203 */ |
1219 function setState(key, value) { | 1204 function setState(key, value) { |
1220 for (var i = 0; i < arguments.length; i = i + 2) { | 1205 for (var i = 0; i < arguments.length; i = i + 2) { |
1221 var key = arguments[i]; | 1206 var key = arguments[i]; |
1222 if (key == 'tests') { | 1207 if (key == 'tests') { |
1223 for (var state in currentState) { | 1208 for (var state in singleBuilderViewParameters) { |
1224 delete currentState[state]; | 1209 delete currentState[state]; |
1225 } | 1210 } |
1226 } else { | 1211 } else { |
1227 delete currentState.tests; | 1212 delete currentState.tests; |
1228 } | 1213 } |
1229 | 1214 |
1230 currentState[key] = arguments[i + 1]; | 1215 currentState[key] = arguments[i + 1]; |
1231 } | 1216 } |
1232 window.location.replace(getPermaLinkURL()); | 1217 window.location.replace(getPermaLinkURL()); |
1233 handleLocationChange(); | 1218 handleLocationChange(); |
1234 } | 1219 } |
1235 | 1220 |
1236 function handleLocationChange() { | 1221 function handleLocationChange() { |
1237 $('loading-ui').style.display = 'block'; | 1222 $('loading-ui').style.display = 'block'; |
1238 setTimeout(function() { | 1223 setTimeout(function() { |
1239 oldLocation = window.location.href; | 1224 oldLocation = window.location.href; |
1240 generatePage(); | 1225 generatePage(); |
1241 }, 0); | 1226 }, 0); |
1242 } | 1227 } |
1243 | 1228 |
1244 function getPermaLinkURL() { | 1229 function getPermaLinkURL() { |
1245 return window.location.pathname + '?' + joinParameters(queryState) + '#' + | 1230 return window.location.pathname + '#' + joinParameters(currentState); |
1246 joinParameters(currentState); | |
1247 } | 1231 } |
1248 | 1232 |
1249 function joinParameters(stateObject) { | 1233 function joinParameters(stateObject) { |
1250 var state = []; | 1234 var state = []; |
1251 for (var key in stateObject) { | 1235 for (var key in stateObject) { |
1252 state.push(key + '=' + encodeURIComponent(stateObject[key])); | 1236 state.push(key + '=' + encodeURIComponent(stateObject[key])); |
1253 } | 1237 } |
1254 return state.join('&'); | 1238 return state.join('&'); |
1255 } | 1239 } |
1256 | 1240 |
(...skipping 10 matching lines...) Expand all Loading... | |
1267 parseAllParameters(); | 1251 parseAllParameters(); |
1268 handleLocationChange(); | 1252 handleLocationChange(); |
1269 } | 1253 } |
1270 }, 100); | 1254 }, 100); |
1271 } | 1255 } |
1272 </script> | 1256 </script> |
1273 </head> | 1257 </head> |
1274 | 1258 |
1275 <body></body> | 1259 <body></body> |
1276 </html> | 1260 </html> |
OLD | NEW |