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(failures) { | 10 function CTFailureGroup(failures, commitList) { |
11 this.failures = failures; | 11 this.failures = failures; |
| 12 this.commitList = commitList; |
12 this._annotation = CTFailureGroup._mergeAnnotations(failures.map(function(fail
ure) { | 13 this._annotation = CTFailureGroup._mergeAnnotations(failures.map(function(fail
ure) { |
13 return failure.annotations(); | 14 return failure.annotations(); |
14 }).flatten()); | 15 }).flatten()); |
15 this._computeProperties(); | 16 this._computeProperties(); |
16 } | 17 } |
17 | 18 |
18 CTFailureGroup.prototype.snoozeUntil = function(time) { | 19 CTFailureGroup.prototype.snoozeUntil = function(time) { |
19 return this._annotate({ | 20 return this._annotate({ |
20 snoozeTime: time, | 21 snoozeTime: time, |
21 }); | 22 }); |
22 }; | 23 }; |
23 | 24 |
24 CTFailureGroup.prototype.unsnooze = function() { | 25 CTFailureGroup.prototype.unsnooze = function() { |
25 return this._annotate({ | 26 return this._annotate({ |
26 snoozeTime: undefined, | 27 snoozeTime: undefined, |
27 }); | 28 }); |
28 }; | 29 }; |
29 | 30 |
30 CTFailureGroup.prototype.commitList = function(commits) { | |
31 return new CTCommitList(this, commits); | |
32 }; | |
33 | |
34 CTFailureGroup.prototype.setBug = function(bug) { | 31 CTFailureGroup.prototype.setBug = function(bug) { |
35 if (/^[0-9]+$/.test(bug)) | 32 if (/^[0-9]+$/.test(bug)) |
36 bug = 'http://crbug.com/' + bug; | 33 bug = 'http://crbug.com/' + bug; |
37 return this._annotate({ | 34 return this._annotate({ |
38 bug: bug, | 35 bug: bug, |
39 }); | 36 }); |
40 }; | 37 }; |
41 | 38 |
42 CTFailureGroup.prototype.clearBug = function(bug) { | 39 CTFailureGroup.prototype.clearBug = function(bug) { |
43 return this._annotate({ | 40 return this._annotate({ |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 }.bind(this)); | 113 }.bind(this)); |
117 }; | 114 }; |
118 | 115 |
119 CTFailureGroup.fetchAnnotations = function() { | 116 CTFailureGroup.fetchAnnotations = function() { |
120 // FIXME: Fetch annotations from frontend. | 117 // FIXME: Fetch annotations from frontend. |
121 var stored = localStorage.CTFailureGroupAnnotations; | 118 var stored = localStorage.CTFailureGroupAnnotations; |
122 var annotations = stored ? JSON.parse(stored) : {}; | 119 var annotations = stored ? JSON.parse(stored) : {}; |
123 return Promise.resolve(annotations); | 120 return Promise.resolve(annotations); |
124 }; | 121 }; |
125 </script> | 122 </script> |
OLD | NEW |