| 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-results-comparison.html"> | 7 <link rel="import" href="ct-results-comparison.html"> |
| 8 | 8 |
| 9 <polymer-element name="ct-results-detail" attributes="test builder result"> | 9 <polymer-element name="ct-results-detail" attributes="test builder result"> |
| 10 <template> | 10 <template> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 result: '_update', | 47 result: '_update', |
| 48 test: '_update', | 48 test: '_update', |
| 49 builder: '_update', | 49 builder: '_update', |
| 50 }, | 50 }, |
| 51 | 51 |
| 52 _update: function() { | 52 _update: function() { |
| 53 if (!this.test || !this.builder || !this.result) | 53 if (!this.test || !this.builder || !this.result) |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 var failureInfo = results.failureInfo(this.test, this.builder, this.resu
lt); | 56 var failureInfo = results.failureInfo(this.test, this.builder, this.resu
lt); |
| 57 // FIXME: Move this logic to a proper model class so that the network re
quests this makes |
| 58 // can be easily mocked out in tests. |
| 57 results.fetchResultsURLs(failureInfo).then(function(resultsUrls) { | 59 results.fetchResultsURLs(failureInfo).then(function(resultsUrls) { |
| 58 var resultsUrlsByTypeAndKind = {}; | 60 var resultsUrlsByTypeAndKind = {}; |
| 59 resultsUrls.forEach(function(url) { | 61 resultsUrls.forEach(function(url) { |
| 60 var resultType = results.resultType(url); | 62 var resultType = results.resultType(url); |
| 61 if (!resultsUrlsByTypeAndKind[resultType]) | 63 if (!resultsUrlsByTypeAndKind[resultType]) |
| 62 resultsUrlsByTypeAndKind[resultType] = {}; | 64 resultsUrlsByTypeAndKind[resultType] = {}; |
| 63 resultsUrlsByTypeAndKind[resultType][results.resultKind(url)] = ur
l; | 65 resultsUrlsByTypeAndKind[resultType][results.resultKind(url)] = ur
l; |
| 64 }); | 66 }); |
| 65 | 67 |
| 66 this._urlGroups = []; | 68 this._urlGroups = []; |
| 67 Object.keys(resultsUrlsByTypeAndKind, function(resultType, resultsUrls
ByKind) { | 69 Object.keys(resultsUrlsByTypeAndKind, function(resultType, resultsUrls
ByKind) { |
| 68 this._urlGroups.push({ | 70 this._urlGroups.push({ |
| 69 type: resultType, | 71 type: resultType, |
| 70 urls: resultsUrlsByKind, | 72 urls: resultsUrlsByKind, |
| 71 }); | 73 }); |
| 72 }.bind(this)); | 74 }.bind(this)); |
| 73 }.bind(this)); | 75 }.bind(this)); |
| 74 }, | 76 }, |
| 75 }); | 77 }); |
| 76 </script> | 78 </script> |
| 77 </polymer-element> | 79 </polymer-element> |
| OLD | NEW |