| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var loadfailures = loadfailures || {}; | 5 var loadfailures = loadfailures || {}; |
| 6 | 6 |
| 7 (function() { | 7 (function() { |
| 8 | 8 |
| 9 loadfailures._groupIndex = 0; | 9 loadfailures._groupIndex = 0; |
| 10 loadfailures._testTypeIndex = 0; | 10 loadfailures._testTypeIndex = 0; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 '<td><a href="http://test-results.appspot.com/testfile?testtype=' + | 83 '<td><a href="http://test-results.appspot.com/testfile?testtype=' + |
| 84 testType + '&builder=' + builder + '&master=' + builderToMaster[buil
der].name + '">uploaded results</a>' + | 84 testType + '&builder=' + builder + '&master=' + builderToMaster[buil
der].name + '">uploaded results</a>' + |
| 85 '<td><a href="' + builderToMaster[builder].builderPath(builder) + '">bui
ldbot</a>' + | 85 '<td><a href="' + builderToMaster[builder].builderPath(builder) + '">bui
ldbot</a>' + |
| 86 '</tr>'; | 86 '</tr>'; |
| 87 } | 87 } |
| 88 | 88 |
| 89 loadfailures._html = function(failureData) | 89 loadfailures._html = function(failureData) |
| 90 { | 90 { |
| 91 var html = ''; | 91 var html = ''; |
| 92 Object.keys(failureData).forEach(function(group) { | 92 Object.keys(failureData).forEach(function(group) { |
| 93 html += '<h1>' + group + '</h1>' + | |
| 94 '<table><tr><th>Test type</th><th>>1 week stale</th><th>>1 day stale
, <1 week stale</th></tr>'; | |
| 95 | |
| 96 var failingBuildersByTestType = failureData[group].failingBuilders; | 93 var failingBuildersByTestType = failureData[group].failingBuilders; |
| 97 var staleBuildersByTestType = failureData[group].staleBuilders; | 94 var staleBuildersByTestType = failureData[group].staleBuilders; |
| 98 var testTypesWithNoSuccessfullLoads = failureData[group].testTypesWithNo
SuccessfullLoads; | 95 var testTypesWithNoSuccessfullLoads = failureData[group].testTypesWithNo
SuccessfullLoads; |
| 99 var builderToMaster = failureData[group].builderToMaster; | 96 var builderToMaster = failureData[group].builderToMaster; |
| 100 | 97 |
| 101 var testTypes = testTypesWithNoSuccessfullLoads.concat(Object.keys(faili
ngBuildersByTestType).concat(Object.keys(staleBuildersByTestType))); | 98 var testTypes = testTypesWithNoSuccessfullLoads.concat(Object.keys(faili
ngBuildersByTestType).concat(Object.keys(staleBuildersByTestType))); |
| 102 var uniqueTestTypes = testTypes.sort().filter(function(value, index, arr
ay) { | 99 var uniqueTestTypes = testTypes.sort().filter(function(value, index, arr
ay) { |
| 103 return array.indexOf(value) === index; | 100 return array.indexOf(value) === index; |
| 104 }); | 101 }); |
| 102 |
| 103 if (!uniqueTestTypes.length) |
| 104 return; |
| 105 |
| 106 html += '<h1>' + group + '</h1>' + |
| 107 '<table><tr><th>Test type</th><th>>1 week stale</th><th>>1 day stale
, <1 week stale</th></tr>'; |
| 108 |
| 105 uniqueTestTypes.forEach(function(testType) { | 109 uniqueTestTypes.forEach(function(testType) { |
| 106 var failures = failingBuildersByTestType[testType] || []; | 110 var failures = failingBuildersByTestType[testType] || []; |
| 107 var failureHtml = ''; | 111 var failureHtml = ''; |
| 108 failures.sort().forEach(function(builder) { | 112 failures.sort().forEach(function(builder) { |
| 109 failureHtml += loadfailures._htmlForBuilder(builder, testType, b
uilderToMaster); | 113 failureHtml += loadfailures._htmlForBuilder(builder, testType, b
uilderToMaster); |
| 110 }); | 114 }); |
| 111 | 115 |
| 112 var stale = staleBuildersByTestType[testType] || []; | 116 var stale = staleBuildersByTestType[testType] || []; |
| 113 var staleHtml = ''; | 117 var staleHtml = ''; |
| 114 stale.sort().forEach(function(builder) { | 118 stale.sort().forEach(function(builder) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 138 | 142 |
| 139 window.addEventListener('load', function() { | 143 window.addEventListener('load', function() { |
| 140 // FIXME: Come up with a better way to do this. This early return is just to
avoid | 144 // FIXME: Come up with a better way to do this. This early return is just to
avoid |
| 141 // executing this code when it's loaded in the unittests. | 145 // executing this code when it's loaded in the unittests. |
| 142 if (!$('content')) | 146 if (!$('content')) |
| 143 return; | 147 return; |
| 144 loadfailures.loadNextTestType(g_history); | 148 loadfailures.loadNextTestType(g_history); |
| 145 }, false); | 149 }, false); |
| 146 | 150 |
| 147 })(); | 151 })(); |
| OLD | NEW |