Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="ct-builder.html"> | 7 <link rel="import" href="ct-builder.html"> |
| 8 | 8 |
| 9 <!-- Table of failure types, listing the failing builders for each type. --> | 9 <!-- Table of failure types, listing the failing builders for each type. --> |
| 10 <polymer-element name="ct-builder-grid" attributes="failures"> | 10 <polymer-element name="ct-builder-grid" attributes="failures builderLatestRevisi ons"> |
| 11 <template> | 11 <template> |
| 12 <style> | 12 <style> |
| 13 table { | 13 table { |
| 14 border-collapse: collapse; | 14 border-collapse: collapse; |
| 15 font-size: 11px; | 15 font-size: 11px; |
| 16 table-layout: fixed; | 16 table-layout: fixed; |
| 17 width: 350px; | 17 width: 350px; |
| 18 } | 18 } |
| 19 | 19 |
| 20 tbody tr { | 20 tbody tr { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 </template> | 96 </template> |
| 97 </td> | 97 </td> |
| 98 </tr> | 98 </tr> |
| 99 </template> | 99 </template> |
| 100 </tbody> | 100 </tbody> |
| 101 </table> | 101 </table> |
| 102 </template> | 102 </template> |
| 103 <script> | 103 <script> |
| 104 Polymer({ | 104 Polymer({ |
| 105 failures: [], | 105 failures: [], |
| 106 builderLatestRevisions: {}, | |
| 106 resultTypes: {}, | 107 resultTypes: {}, |
| 107 | 108 |
| 108 keys: function(obj) { | 109 keys: function(obj) { |
| 109 return Object.keys(obj).sort(); | 110 return Object.keys(obj).sort(); |
| 110 }, | 111 }, |
| 111 | 112 |
| 112 resultTypeKeys: function(obj) { | 113 resultTypeKeys: function(obj) { |
| 113 // Get the keys, but the BUILDING type should be last. | 114 // Get the keys, but the BUILDING type should be last. |
| 114 var keys = this.keys(obj); | 115 var keys = this.keys(obj); |
| 115 var index = keys.indexOf('BUILDING'); | 116 var index = keys.indexOf('BUILDING'); |
| 116 if (index != -1) { | 117 if (index != -1) { |
| 117 var buildingResult = keys.splice(index, 1); | 118 var buildingResult = keys.splice(index, 1); |
| 118 keys.push(buildingResult[0]); | 119 keys.push(buildingResult[0]); |
| 119 } | 120 } |
| 120 return keys; | 121 return keys; |
| 121 }, | 122 }, |
| 122 | 123 |
| 123 failuresChanged: function() { | 124 failuresChanged: function() { |
| 124 // Create a set of builders for each result type (e.g., text, crash). | 125 // Create a set of builders for each result type (e.g., text, crash). |
| 125 this.resultTypes = {}; | 126 this.resultTypes = {}; |
| 126 var passingRevisions = []; | 127 var passingRevisions = []; |
| 127 this.failures.forEach(function(failure) { | 128 this.failures.forEach(function(failure) { |
| 128 passingRevisions.push(failure.newestPassingRevision); | 129 passingRevisions.push(failure.newestPassingRevision); |
| 129 var results = failure.resultNodesByBuilder; | 130 var results = failure.resultNodesByBuilder; |
| 130 Object.keys(results, (function(builderName) { | 131 Object.keys(results, (function(builder) { |
| 131 var result = results[builderName]; | 132 var result = results[builder]; |
| 132 if (!result.is_unexpected) | 133 if (!result.is_unexpected) |
| 133 return; | 134 return; |
| 134 | 135 |
| 135 if (!Object.has(this.resultTypes, result.actual)) | 136 if (!Object.has(this.resultTypes, result.actual)) |
| 136 this.resultTypes[result.actual] = {}; | 137 this.resultTypes[result.actual] = {}; |
| 137 this.resultTypes[result.actual][builderName] = | 138 this.resultTypes[result.actual][builder] = |
| 138 config.builders[builderName]; | 139 config.builders[builder]; |
| 139 }).bind(this)); | 140 }).bind(this)); |
| 140 }, this); | 141 }, this); |
| 141 | 142 |
| 142 var buildingType = this._getBuilding(passingRevisions); | 143 var buildingType = this._getBuilding(passingRevisions); |
| 143 if (!Object.isEmpty(buildingType)) | 144 if (!Object.isEmpty(buildingType)) |
| 144 this.resultTypes['BUILDING'] = buildingType; | 145 this.resultTypes['BUILDING'] = buildingType; |
| 145 }, | 146 }, |
| 146 | 147 |
| 148 _buildersInFlightForRevision: function(revision) { | |
| 149 var builders = {}; | |
| 150 Object.keys(this.builderLatestRevisions, function(builder, revisions) { | |
| 151 // FIXME: This should look at all chromium/v8/etc revisions as well. | |
| 152 // Is this concept of "building" builders even useful as is? | |
| 153 if (parseInt(revisions.blink, 10) < revision) | |
| 154 builders[builder] = 1; | |
| 155 }); | |
| 156 return Object.keys(builders); | |
|
michaelpg
2014/07/21 07:28:48
Can you simplify this? Something like:
return Obj
ojan
2014/07/21 19:58:04
Much better. Although, I got rid of the hard to re
| |
| 157 }, | |
| 158 | |
| 147 _getBuilding: function(revisions) { | 159 _getBuilding: function(revisions) { |
| 148 var building = {}; | 160 var building = {}; |
| 149 var builderNames = []; | 161 var builders = []; |
| 150 revisions.unique().forEach(function(revision) { | 162 revisions.unique().forEach(function(revision) { |
| 151 builderNames.push.apply(builderNames, | 163 builders.push.apply(builders, this._buildersInFlightForRevision(revisi on + 1)); |
|
michaelpg
2014/07/21 07:28:48
again, can we keep this to 80 chars? Or is that no
| |
| 152 Object.keys(model.buildersInFlightForRevision(revision + 1))); | 164 }.bind(this)); |
| 165 | |
| 166 builders.unique().forEach(function(builder) { | |
| 167 if (!config.builders[builder]) | |
| 168 return; | |
| 169 building[builder] = {'debug': config.builders[builder].debug}; | |
| 153 }); | 170 }); |
| 154 builderNames.unique().forEach(function(builderName) { | 171 |
| 155 if (!config.builders[builderName]) | |
| 156 return; | |
| 157 building[builderName] = | |
| 158 {'debug': config.builders[builderName].debug}; | |
| 159 }); | |
| 160 return building; | 172 return building; |
| 161 }, | 173 }, |
| 162 }); | 174 }); |
| 163 </script> | 175 </script> |
| 164 </polymer-element> | 176 </polymer-element> |
| OLD | NEW |