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, revisions, annotation) { |
11 this.key = key; | 11 this.key = key; |
12 this.failures = failures; | 12 this.failures = failures; |
13 this.revisions = revisions.slice() || []; | |
ojan
2014/08/23 01:23:05
No need for the || here, right?
Mathieu
2014/08/24 23:42:11
Done.
| |
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 CTFailureGroup.prototype.commitList = function(commits) { |
30 return new CTCommitList(this, commits); | 31 return new CTCommitList(commits, this.revisions); |
31 }; | 32 }; |
32 | 33 |
33 CTFailureGroup.prototype.setBug = function(bug) { | 34 CTFailureGroup.prototype.setBug = function(bug) { |
34 if (/^[0-9]+$/.test(bug)) | 35 if (/^[0-9]+$/.test(bug)) |
35 bug = 'http://crbug.com/' + bug; | 36 bug = 'http://crbug.com/' + bug; |
36 return this._annotate({ | 37 return this._annotate({ |
37 bug: bug, | 38 bug: bug, |
38 }); | 39 }); |
39 }; | 40 }; |
40 | 41 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 }.bind(this)); | 87 }.bind(this)); |
87 }; | 88 }; |
88 | 89 |
89 CTFailureGroup.fetchAnnotations = function() { | 90 CTFailureGroup.fetchAnnotations = function() { |
90 // FIXME: Fetch annotations from frontend. | 91 // FIXME: Fetch annotations from frontend. |
91 var stored = localStorage.CTFailureGroupAnnotations; | 92 var stored = localStorage.CTFailureGroupAnnotations; |
92 var annotations = stored ? JSON.parse(stored) : {}; | 93 var annotations = stored ? JSON.parse(stored) : {}; |
93 return Promise.resolve(annotations); | 94 return Promise.resolve(annotations); |
94 }; | 95 }; |
95 </script> | 96 </script> |
OLD | NEW |