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, failures, annotation) { | 10 function CTFailureGroup(key, failures, commitList, annotation) { |
11 this.key = key; | 11 this.key = key; |
12 this.failures = failures; | 12 this.failures = failures; |
| 13 this.commitList = commitList; |
13 this._annotation = annotation || {}; | 14 this._annotation = annotation || {}; |
14 this._computeProperties(); | 15 this._computeProperties(); |
15 } | 16 } |
16 | 17 |
17 CTFailureGroup.prototype.snoozeUntil = function(time) { | 18 CTFailureGroup.prototype.snoozeUntil = function(time) { |
18 return this._annotate({ | 19 return this._annotate({ |
19 snoozeTime: time, | 20 snoozeTime: time, |
20 }); | 21 }); |
21 }; | 22 }; |
22 | 23 |
23 CTFailureGroup.prototype.unsnooze = function() { | 24 CTFailureGroup.prototype.unsnooze = function() { |
24 return this._annotate({ | 25 return this._annotate({ |
25 snoozeTime: undefined, | 26 snoozeTime: undefined, |
26 }); | 27 }); |
27 }; | 28 }; |
28 | 29 |
29 CTFailureGroup.prototype.commitList = function(commits) { | |
30 return new CTCommitList(this, commits); | |
31 }; | |
32 | |
33 CTFailureGroup.prototype.setBug = function(bug) { | 30 CTFailureGroup.prototype.setBug = function(bug) { |
34 if (/^[0-9]+$/.test(bug)) | 31 if (/^[0-9]+$/.test(bug)) |
35 bug = 'http://crbug.com/' + bug; | 32 bug = 'http://crbug.com/' + bug; |
36 return this._annotate({ | 33 return this._annotate({ |
37 bug: bug, | 34 bug: bug, |
38 }); | 35 }); |
39 }; | 36 }; |
40 | 37 |
41 CTFailureGroup.prototype.clearBug = function(bug) { | 38 CTFailureGroup.prototype.clearBug = function(bug) { |
42 return this._annotate({ | 39 return this._annotate({ |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 }.bind(this)); | 83 }.bind(this)); |
87 }; | 84 }; |
88 | 85 |
89 CTFailureGroup.fetchAnnotations = function() { | 86 CTFailureGroup.fetchAnnotations = function() { |
90 // FIXME: Fetch annotations from frontend. | 87 // FIXME: Fetch annotations from frontend. |
91 var stored = localStorage.CTFailureGroupAnnotations; | 88 var stored = localStorage.CTFailureGroupAnnotations; |
92 var annotations = stored ? JSON.parse(stored) : {}; | 89 var annotations = stored ? JSON.parse(stored) : {}; |
93 return Promise.resolve(annotations); | 90 return Promise.resolve(annotations); |
94 }; | 91 }; |
95 </script> | 92 </script> |
OLD | NEW |