| 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 <polymer-element name="ct-failure-analyzer" attributes="failures status"> | 7 <polymer-element name="ct-failure-analyzer" attributes="failures status"> |
| 8 <script> | 8 <script> |
| 9 Polymer({ | 9 Polymer({ |
| 10 failures: [], | 10 failures: {}, |
| 11 | 11 pendingUnexpectedFailures: [], |
| 12 pendingFailures: [], | |
| 13 | 12 |
| 14 update: function() { | 13 update: function() { |
| 15 this.pendingFailures = []; | 14 this._updateFailingBuilders(); |
| 15 this._updateUnexpectedFailures(); |
| 16 }, |
| 17 |
| 18 _updateFailingBuilders: function() { |
| 19 builders.buildersFailingNonLayoutTests().then((function(builders) { |
| 20 this.failures.builders = builders; |
| 21 }).bind(this)); |
| 22 }, |
| 23 |
| 24 _updateUnexpectedFailures: function() { |
| 25 this.pendingUnexpectedFailures = []; |
| 16 var numberOfTestsAnalyzed = 0; | 26 var numberOfTestsAnalyzed = 0; |
| 17 this.status = 'Updating ...'; | 27 this.status = 'Updating ...'; |
| 18 Promise.all([model.updateRecentCommits(), model.updateResultsByBuilder()
]).then(function() { | 28 Promise.all([model.updateRecentCommits(), model.updateResultsByBuilder()
]).then(function() { |
| 19 this.status = 'Analyzing test failures ...'; | 29 this.status = 'Analyzing test failures ...'; |
| 20 model.analyzeUnexpectedFailures(function(failureAnalysis, total) { | 30 model.analyzeUnexpectedFailures(function(failureAnalysis, total) { |
| 21 this.status = 'Analyzing test failures ... ' + ++numberOfTestsAnalyz
ed + '/' + total + ' tests analyzed.'; | 31 this.status = 'Analyzing test failures ... ' + ++numberOfTestsAnalyz
ed + '/' + total + ' tests analyzed.'; |
| 22 this.pendingFailures.push(failureAnalysis); | 32 this.pendingUnexpectedFailures.push(failureAnalysis); |
| 23 }.bind(this)).then(function() { | 33 }.bind(this)).then(function() { |
| 24 this.status = 'Done!!!'; | 34 this.status = 'Done!!!'; |
| 25 this.failures = this.pendingFailures; | 35 this.failures.unexpected = this.pendingUnexpectedFailures; |
| 26 }.bind(this)); | 36 }.bind(this)); |
| 27 }.bind(this)); | 37 }.bind(this)); |
| 28 }, | 38 }, |
| 29 }); | 39 }); |
| 30 </script> | 40 </script> |
| 31 </polymer-element> | 41 </polymer-element> |
| OLD | NEW |