| OLD | NEW |
| 1 // Copyright (C) 2013 Google Inc. All rights reserved. | 1 // Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
| 5 // met: | 5 // met: |
| 6 // | 6 // |
| 7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
| 9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
| 10 // copyright notice, this list of conditions and the following disclaimer | 10 // copyright notice, this list of conditions and the following disclaimer |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 var isSelected = currentFileName == fileName; | 165 var isSelected = currentFileName == fileName; |
| 166 var onClick = 'ui.html._loadDashboard(\'' + fileName + '\')'; | 166 var onClick = 'ui.html._loadDashboard(\'' + fileName + '\')'; |
| 167 return ui.html._topLink(html, onClick, isSelected); | 167 return ui.html._topLink(html, onClick, isSelected); |
| 168 } | 168 } |
| 169 | 169 |
| 170 ui.html._revisionLink = function(resultsKey, testResults, index) | 170 ui.html._revisionLink = function(resultsKey, testResults, index) |
| 171 { | 171 { |
| 172 var currentRevision = parseInt(testResults[resultsKey][index], 10); | 172 var currentRevision = parseInt(testResults[resultsKey][index], 10); |
| 173 var previousRevision = parseInt(testResults[resultsKey][index + 1], 10); | 173 var previousRevision = parseInt(testResults[resultsKey][index + 1], 10); |
| 174 | 174 |
| 175 // TODO(ojan): chromium/src is the only repository supported by crrev.com. |
| 176 // Once blink is supported, send all code down the isChrome codepath. |
| 175 var isChrome = resultsKey == results.CHROME_REVISIONS; | 177 var isChrome = resultsKey == results.CHROME_REVISIONS; |
| 176 var singleUrl = 'http://src.chromium.org/viewvc/' + (isChrome ? 'chrome' : '
blink') + '?view=rev&revision=' + currentRevision; | 178 |
| 179 var singleUrl; |
| 180 if (isChrome) |
| 181 singleUrl = 'https://crrev.com/' + currentRevision; |
| 182 else |
| 183 singleUrl = 'http://src.chromium.org/viewvc/blink?view=rev&revision=' +
currentRevision; |
| 177 | 184 |
| 178 if (currentRevision == previousRevision) | 185 if (currentRevision == previousRevision) |
| 179 return 'At <a href="' + singleUrl + '">r' + currentRevision + '</a>'; | 186 return 'At <a href="' + singleUrl + '">r' + currentRevision + '</a>'; |
| 180 | 187 |
| 181 if (currentRevision - previousRevision == 1) | 188 if (currentRevision - previousRevision == 1) |
| 182 return '<a href="' + singleUrl + '">r' + currentRevision + '</a>'; | 189 return '<a href="' + singleUrl + '">r' + currentRevision + '</a>'; |
| 183 | 190 |
| 184 var rangeUrl = 'http://build.chromium.org/f/chromium/perf/dashboard/ui/chang
elog' + | 191 var rangeUrl; |
| 185 (isChrome ? '' : '_blink') + '.html?url=/trunk' + (isChrome ? '/src' : '
') + | 192 if (isChrome) { |
| 186 '&range=' + (previousRevision + 1) + ':' + currentRevision + '&mode=html
'; | 193 // Intentionally do not increment previous revision. This rev works the |
| 194 // way gitiles does (exclude the start of the range) instead of the way |
| 195 // the perf dashboard below does. |
| 196 rangeUrl = '../../rev?start=' + previousRevision + '&end=' + currentRevi
sion; |
| 197 } else { |
| 198 rangeUrl = 'http://build.chromium.org/f/chromium/perf/dashboard/ui/chang
elog_blink.html?url=/trunk' + |
| 199 '&range=' + (previousRevision + 1) + ':' + currentRevision + '&mode=
html'; |
| 200 } |
| 201 |
| 187 return '<a href="' + rangeUrl + '">r' + (previousRevision + 1) + ' to r' + c
urrentRevision + '</a>'; | 202 return '<a href="' + rangeUrl + '">r' + (previousRevision + 1) + ' to r' + c
urrentRevision + '</a>'; |
| 188 } | 203 } |
| 189 | 204 |
| 190 ui.html.chromiumRevisionLink = function(testResults, index) | 205 ui.html.chromiumRevisionLink = function(testResults, index) |
| 191 { | 206 { |
| 192 return ui.html._revisionLink(results.CHROME_REVISIONS, testResults, index); | 207 return ui.html._revisionLink(results.CHROME_REVISIONS, testResults, index); |
| 193 } | 208 } |
| 194 | 209 |
| 195 ui.html.blinkRevisionLink = function(testResults, index) | 210 ui.html.blinkRevisionLink = function(testResults, index) |
| 196 { | 211 { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 221 { | 236 { |
| 222 this._messages += message + '<br>'; | 237 this._messages += message + '<br>'; |
| 223 }, | 238 }, |
| 224 hasErrors: function() | 239 hasErrors: function() |
| 225 { | 240 { |
| 226 return !!this._messages; | 241 return !!this._messages; |
| 227 } | 242 } |
| 228 } | 243 } |
| 229 | 244 |
| 230 })(); | 245 })(); |
| OLD | NEW |