Chromium Code Reviews| Index: Tools/GardeningServer/ui/ct-failure-grouper.html |
| diff --git a/Tools/GardeningServer/ui/ct-failure-grouper.html b/Tools/GardeningServer/ui/ct-failure-grouper.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4893bd625feaec82a3e9ca0e20f99c063bdb9785 |
| --- /dev/null |
| +++ b/Tools/GardeningServer/ui/ct-failure-grouper.html |
| @@ -0,0 +1,36 @@ |
| +<!-- |
| +Copyright 2014 The Chromium Authors. All rights reserved. |
| +Use of this source code is governed by a BSD-style license that can be |
| +found in the LICENSE file. |
| +--> |
| + |
| +<polymer-element name="ct-failure-grouper" attributes="failures groups"> |
| + <script> |
| + Polymer({ |
| + failures: [], |
| + groups: [], |
| + |
| + failureComparator: function(a, b) { |
| + return a.testName < b.testName; |
| + }, |
| + |
| + failuresChanged: function() { |
| + var map = {}; |
| + for (var i = 0; i < this.failures.length; ++i) { |
| + var failureAnalysis = this.failures[i]; |
| + var key = failureAnalysis.newestPassingRevision + "+" + failureAnalysis.oldestFailingRevision; |
| + if (!(key in map)) |
| + map[key] = []; |
| + map[key].push(failureAnalysis); |
| + } |
| + |
| + this.groups = []; |
| + var keys = Object.getOwnPropertyNames(map).sort(); |
| + for (var i = 0; i < keys.length; ++i) { |
| + var key = keys[i]; |
| + this.groups[i] = map[key].sort(this.failureComparator.bind(this)); |
|
ojan
2014/06/28 16:50:09
Why the bind?
abarth-chromium
2014/06/28 17:52:37
Just so I don't get bitten by not having the right
|
| + } |
| + }, |
| + }); |
| + </script> |
| +</polymer-element> |