Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2017 The Chromium Authors. All rights reserved. | 3 Copyright 2017 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/dashboard/elements/benchmark-health-report-page.html"> | 8 <link rel="import" href="/dashboard/elements/benchmark-health-report-page.html"> |
| 9 <link rel="import" href="/dashboard/static/testing_common.html"> | 9 <link rel="import" href="/dashboard/static/testing_common.html"> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 'v8' | 36 'v8' |
| 37 ] | 37 ] |
| 38 }; | 38 }; |
| 39 testing_common.addXhrMock('/benchmark_health_report?master=ChromiumPerf', | 39 testing_common.addXhrMock('/benchmark_health_report?master=ChromiumPerf', |
| 40 JSON.stringify(mockResponse)); | 40 JSON.stringify(mockResponse)); |
| 41 var page = document.createElement('benchmark-health-report-page'); | 41 var page = document.createElement('benchmark-health-report-page'); |
| 42 this.addHTMLOutput(page); | 42 this.addHTMLOutput(page); |
| 43 }, testOptions); | 43 }, testOptions); |
| 44 | 44 |
| 45 test('instantiation_benchmark', function() { | 45 test('instantiation_benchmark', function() { |
| 46 var mockResponse = { | 46 var mockHealthReportResponse = { |
| 47 'alerts': [{ | 47 'alerts': [{ |
| 48 'absolute_delta': '54.000000', | 48 'absolute_delta': '54.000000', |
| 49 'bot': 'android-nexus7v2', | 49 'bot': 'android-nexus7v2', |
| 50 'bug_id': 687592, | 50 'bug_id': 687592, |
| 51 'dashboard_link': '/report?blah', | 51 'dashboard_link': '/report?blah', |
| 52 'date': '2017-02-03', | 52 'date': '2017-02-03', |
| 53 'end_revision': 447242, | 53 'end_revision': 447242, |
| 54 'group': 'agxzfmNocm9tZXBlcmZyFwsSCkFsZXJ0R3JvdXAYgIDgiI2N-wgM', | 54 'group': 'agxzfmNocm9tZXBlcmZyFwsSCkFsZXJ0R3JvdXAYgIDgiI2N-wgM', |
| 55 'improvement': false, | 55 'improvement': false, |
| 56 'key': 'agxzfmNocm9tZXBlcmZyFAsSB0Fub21hbHkYgIDgqKzesQoM', | 56 'key': 'agxzfmNocm9tZXBlcmZyFAsSB0Fub21hbHkYgIDgqKzesQoM', |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 'percent_changed': '0.1%', | 126 'percent_changed': '0.1%', |
| 127 'start_revision': 467215, | 127 'start_revision': 467215, |
| 128 'test': 'Total', | 128 'test': 'Total', |
| 129 'testsuite': 'sunspider', | 129 'testsuite': 'sunspider', |
| 130 'type': 'anomaly', | 130 'type': 'anomaly', |
| 131 'units': 'ms', | 131 'units': 'ms', |
| 132 }], | 132 }], |
| 133 'bots': ['linux', 'android-nexus7v2', 'android-one', 'windows'], | 133 'bots': ['linux', 'android-nexus7v2', 'android-one', 'windows'], |
| 134 'monitored': true | 134 'monitored': true |
| 135 }; | 135 }; |
| 136 var mockBug12345Response = { | |
| 137 'review_urls': ['https://codereview.chromium.org/2706813003/'], | |
| 138 'bisects': [ | |
| 139 { | |
| 140 'status': 'completed', | |
| 141 'metric': 'Total', | |
| 142 'buildbucket_link': '/foo/bar', | |
| 143 'bot': 'android-nexus7v2-perf-bisect' | |
| 144 } | |
| 145 ], | |
| 146 'owner': 'foo@bar.com', | |
| 147 'published': '2017-02-17T23:08:44', | |
| 148 'state': 'open', | |
| 149 'status': 'Untriaged', | |
| 150 'summary': 'A regression in Sunspider occurred!' | |
| 151 }; | |
| 152 var mockBug687592Response = { | |
| 153 'review_urls': [], | |
| 154 'bisects': [ | |
| 155 { | |
| 156 'status': 'failed', | |
| 157 'metric': 'Total', | |
| 158 'buildbucket_link': '/foo/bar', | |
| 159 'bot': 'android-nexus5-perf-bisect' | |
| 160 }, | |
| 161 { | |
| 162 'status': 'started', | |
| 163 'metric': 'Total', | |
| 164 'buildbucket_link': '/foo/bar', | |
| 165 'bot': 'windows-perf-bisect' | |
| 166 }, | |
| 167 ], | |
| 168 'owner': 'foo@bar.com', | |
| 169 'published': '2017-02-17T23:08:44', | |
| 170 'state': 'open', | |
| 171 'status': 'Untriaged', | |
| 172 'summary': 'A regression in Sunspider occurred!' | |
| 173 }; | |
| 174 testing_common.addXhrMock( | |
| 175 '/benchmark_health_report?master=ChromiumPerf' + | |
| 176 '&benchmark=sunspider&num_days=30', | |
| 177 JSON.stringify(mockHealthReportResponse)); | |
| 178 // NOTE! Need to uncomment the testing_common.clearXhrMock statement | |
| 179 // in tearDown to get these to work correctly when poking at this locally; | |
| 180 // the test completes before these are called :( | |
|
sullivan
2017/02/21 03:25:35
Does anyone know of a solution to this? It's prett
| |
| 181 testing_common.addXhrMock( | |
| 182 '/bug_details?bug_id=12345', | |
| 183 JSON.stringify(mockBug12345Response)); | |
| 184 testing_common.addXhrMock( | |
| 185 '/bug_details?bug_id=687592', | |
| 186 JSON.stringify(mockBug687592Response)); | |
| 136 uri.getParameter = function(name) { | 187 uri.getParameter = function(name) { |
| 137 return { | 188 return { |
| 138 'benchmark': 'sunspider', | 189 'benchmark': 'sunspider', |
| 139 'master': 'ChromiumPerf', | 190 'master': 'ChromiumPerf', |
| 140 'num_days': '30' | 191 'num_days': '30' |
| 141 }[name]; | 192 }[name]; |
| 142 }; | 193 }; |
| 143 testing_common.addXhrMock( | |
| 144 '/benchmark_health_report?master=ChromiumPerf' + | |
| 145 '&benchmark=sunspider&num_days=30', | |
| 146 JSON.stringify(mockResponse)); | |
| 147 var page = document.createElement('benchmark-health-report-page'); | 194 var page = document.createElement('benchmark-health-report-page'); |
| 148 this.addHTMLOutput(page); | 195 this.addHTMLOutput(page); |
| 149 }, testOptions); | 196 }, testOptions); |
| 150 }); | 197 }); |
| 151 </script> | 198 </script> |
| OLD | NEW |