Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Tools / GardeningServer / model / ct-builder-list.html
1 <!--
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
4 found in the LICENSE file.
5 -->
6
7 <link rel='import' href='ct-builder.html'>
8
9 <script>
10 // .builders[i] will have the CTBuilder objects
11 function CTBuilderList(failures) {
12   this.builders = [];
13
14   if (!Array.isArray(failures))
15     failures = [failures];
16
17   var builderMap = {};
18   failures.forEach(function(failure) {
19     var results = failure.resultNodesByBuilder;
20     Object.keys(results, (function(builder, result) {
21       if (!builderMap[builder])
22         builderMap[builder] = {};
23       builderMap[builder][result.masterUrl] = {
24         failingBuildCount: result.failingBuildCount,
25       };
26     }).bind(this));
27   }, this);
28
29   Object.keys(builderMap).sort().forEach(function(builder) {
30     Object.keys(builderMap[builder]).sort().forEach(function(masterUrl) {
31       var result = builderMap[builder][masterUrl];
32       this.builders.push(new CTBuilder(masterUrl, builder, result.failingBuildCount));
33     }, this);
34   }, this);
35 }
36 </script>