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"> |
| 8 |
7 <script> | 9 <script> |
8 function CTFailureGroup(key, failures, annotation) { | 10 function CTFailureGroup(key, failures, annotation) { |
9 this.key = key; | 11 this.key = key; |
10 this.failures = failures; | 12 this.failures = failures; |
11 this.annotation = annotation || {}; | 13 this.annotation = annotation || {}; |
12 this._computeProperties(); | 14 this._computeProperties(); |
13 } | 15 } |
14 | 16 |
15 CTFailureGroup.prototype.snoozeUntil = function(time) { | 17 CTFailureGroup.prototype.snoozeUntil = function(time) { |
16 return this._annotate({ | 18 return this._annotate({ |
17 snoozeTime: time, | 19 snoozeTime: time, |
18 }); | 20 }); |
19 }; | 21 }; |
20 | 22 |
21 CTFailureGroup.prototype.unsnooze = function() { | 23 CTFailureGroup.prototype.unsnooze = function() { |
22 return this._annotate({ | 24 return this._annotate({ |
23 snoozeTime: undefined, | 25 snoozeTime: undefined, |
24 }); | 26 }); |
25 }; | 27 }; |
26 | 28 |
| 29 CTFailureGroup.prototype.commitList = function(commits) { |
| 30 return new CTCommitList(this, commits); |
| 31 }; |
| 32 |
27 CTFailureGroup.prototype._computeProperties = function() { | 33 CTFailureGroup.prototype._computeProperties = function() { |
28 this.isSnoozed = Date.now() < this.annotation.snoozeTime; | 34 this.isSnoozed = Date.now() < this.annotation.snoozeTime; |
29 if (this.isSnoozed) { | 35 if (this.isSnoozed) { |
30 this.category = 'snoozed'; | 36 this.category = 'snoozed'; |
31 } else { | 37 } else { |
32 // FIXME: crbug.com/400397 Split into: Whole step failure, Tree closer, Test
failure, Flaky tests | 38 // FIXME: crbug.com/400397 Split into: Whole step failure, Tree closer, Test
failure, Flaky tests |
33 this.category = 'default'; | 39 this.category = 'default'; |
34 } | 40 } |
35 }; | 41 }; |
36 | 42 |
(...skipping 23 matching lines...) Expand all Loading... |
60 }.bind(this)); | 66 }.bind(this)); |
61 }; | 67 }; |
62 | 68 |
63 CTFailureGroup.fetchAnnotations = function() { | 69 CTFailureGroup.fetchAnnotations = function() { |
64 // FIXME: Fetch annotations from frontend. | 70 // FIXME: Fetch annotations from frontend. |
65 var stored = localStorage.CTFailureGroupAnnotations; | 71 var stored = localStorage.CTFailureGroupAnnotations; |
66 var annotations = stored ? JSON.parse(stored) : {}; | 72 var annotations = stored ? JSON.parse(stored) : {}; |
67 return Promise.resolve(annotations); | 73 return Promise.resolve(annotations); |
68 }; | 74 }; |
69 </script> | 75 </script> |
OLD | NEW |