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-commit-list.html"> | 7 <link rel="import" href="ct-commit-list.html"> |
| 8 | 8 |
| 9 <script> | 9 <script> |
| 10 function CTFailureGroup(key, data) { | 10 function CTFailureGroup(key, data) { |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 | 40 |
| 41 CTFailureGroup.prototype.clearBug = function(bug) { | 41 CTFailureGroup.prototype.clearBug = function(bug) { |
| 42 return this._annotate({ | 42 return this._annotate({ |
| 43 bug: undefined, | 43 bug: undefined, |
| 44 }); | 44 }); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 CTFailureGroup.prototype._failedOnce = function() { | 47 CTFailureGroup.prototype._failedOnce = function() { |
| 48 var totalFailures = 0; | 48 var totalFailures = 0; |
| 49 for (var i = 0; i < this.data.dataToExamine().length; i++) { | 49 for (var i = 0; i < this.data.dataToExamine().length; i++) { |
| 50 var resultNodes = this.data.dataToExamine()[i].resultNodesByBuilder; | 50 var resultNodes = this.data.dataToExamine()[i].resultNodesByBuilder; |
|
esprehn
2014/09/10 02:40:23
What does dataToExamine() do? Calling it repeatedl
ojan
2014/09/10 03:41:18
Yeah, this isn't right. Particularly, this concept
| |
| 51 Object.keys(resultNodes, function(r) { | 51 for (var r in resultNodes) { |
| 52 totalFailures += resultNodes[r].failingBuildCount; | 52 totalFailures += resultNodes[r].failingBuildCount; |
| 53 if (totalFailures > 1) | 53 if (totalFailures > 1) |
| 54 return false; | 54 return false; |
| 55 }.bind(this)); | 55 } |
| 56 } | 56 } |
| 57 return totalFailures == 1; | 57 return totalFailures == 1; |
|
esprehn
2014/09/10 02:40:23
This can just return true right? If you got here y
ojan
2014/09/10 03:41:18
Technically it's possible to have no failures in t
| |
| 58 } | 58 } |
| 59 | 59 |
| 60 CTFailureGroup.prototype._computeProperties = function() { | 60 CTFailureGroup.prototype._computeProperties = function() { |
| 61 this.isSnoozed = Date.now() < this._annotation.snoozeTime; | 61 this.isSnoozed = Date.now() < this._annotation.snoozeTime; |
| 62 if (this.isSnoozed) { | 62 if (this.isSnoozed) { |
| 63 this.category = 'snoozed'; | 63 this.category = 'snoozed'; |
| 64 } else { | 64 } else { |
| 65 if (this._failedOnce()) { | 65 if (this._failedOnce()) { |
| 66 this.category = 'failedOnce'; | 66 this.category = 'failedOnce'; |
| 67 } else { | 67 } else { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 }.bind(this)); | 126 }.bind(this)); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 CTFailureGroup.fetchAnnotations = function() { | 129 CTFailureGroup.fetchAnnotations = function() { |
| 130 // FIXME: Fetch annotations from frontend. | 130 // FIXME: Fetch annotations from frontend. |
| 131 var stored = localStorage.CTFailureGroupAnnotations; | 131 var stored = localStorage.CTFailureGroupAnnotations; |
| 132 var annotations = stored ? JSON.parse(stored) : {}; | 132 var annotations = stored ? JSON.parse(stored) : {}; |
| 133 return Promise.resolve(annotations); | 133 return Promise.resolve(annotations); |
| 134 }; | 134 }; |
| 135 </script> | 135 </script> |
| OLD | NEW |