Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 addResults: function(resultsURLs) | 38 addResults: function(resultsURLs) |
| 39 { | 39 { |
| 40 var resultsURLsByTypeAndKind = {}; | 40 var resultsURLsByTypeAndKind = {}; |
| 41 resultsURLs.forEach(function(url) { | 41 resultsURLs.forEach(function(url) { |
| 42 var resultType = results.resultType(url); | 42 var resultType = results.resultType(url); |
| 43 if (!resultsURLsByTypeAndKind[resultType]) | 43 if (!resultsURLsByTypeAndKind[resultType]) |
| 44 resultsURLsByTypeAndKind[resultType] = {}; | 44 resultsURLsByTypeAndKind[resultType] = {}; |
| 45 resultsURLsByTypeAndKind[resultType][results.resultKind(url)] = url; | 45 resultsURLsByTypeAndKind[resultType][results.resultKind(url)] = url; |
| 46 }); | 46 }); |
| 47 | 47 |
| 48 $.each(resultsURLsByTypeAndKind, function(resultType, resultsURLsByKind) { | 48 Object.keys(resultsURLsByTypeAndKind, function(resultType, resultsURLsBy Kind) { |
| 49 if (results.kUnknownKind in resultsURLsByKind) { | 49 if (results.kUnknownKind in resultsURLsByKind) { |
| 50 // This is something like "crash" that isn't a comparison. | 50 // This is something like "crash" that isn't a comparison. |
| 51 var result = document.createElement('ct-test-output'); | 51 var result = document.createElement('ct-test-output'); |
| 52 result.url = resultsURLsByKind[results.kUnknownKind]; | 52 result.url = resultsURLsByKind[results.kUnknownKind]; |
| 53 result.type = results.kTextType; | 53 result.type = results.kTextType; |
| 54 this.appendChild(result); | 54 this.appendChild(result); |
| 55 return; | 55 return; |
| 56 } | 56 } |
| 57 | 57 |
| 58 var comparison = document.createElement('ct-results-comparison'); | 58 var comparison = document.createElement('ct-results-comparison'); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 82 this._haveShownOnce = false; | 82 this._haveShownOnce = false; |
| 83 }, | 83 }, |
| 84 show: function() { | 84 show: function() { |
| 85 if (this._haveShownOnce) | 85 if (this._haveShownOnce) |
| 86 return; | 86 return; |
| 87 this._haveShownOnce = true; | 87 this._haveShownOnce = true; |
| 88 this._delegate.fetchResultsURLs(this._failureInfo).then(function(results URLs) { | 88 this._delegate.fetchResultsURLs(this._failureInfo).then(function(results URLs) { |
| 89 var resultsGrid = new ui.results.ResultsGrid(); | 89 var resultsGrid = new ui.results.ResultsGrid(); |
| 90 resultsGrid.addResults(resultsURLs); | 90 resultsGrid.addResults(resultsURLs); |
| 91 | 91 |
| 92 $(this).empty().append( | 92 this.innerHTML = '' |
| 93 this.appendChild( | |
| 93 new ui.actions.List([ | 94 new ui.actions.List([ |
| 94 new ui.actions.Previous(), | 95 new ui.actions.Previous(), |
| 95 new ui.actions.Next() | 96 new ui.actions.Next() |
| 96 ])).append(resultsGrid); | 97 ])) |
| 98 this.appendChild(resultsGrid); | |
| 97 }.bind(this)); | 99 }.bind(this)); |
| 98 }, | 100 }, |
| 99 }); | 101 }); |
| 100 | 102 |
| 101 ui.results.FlakinessData = base.extends('iframe', { | 103 ui.results.FlakinessData = base.extends('iframe', { |
| 102 init: function() | 104 init: function() |
| 103 { | 105 { |
| 104 this.className = 'flakiness-iframe'; | 106 this.className = 'flakiness-iframe'; |
| 105 this.src = ui.urlForEmbeddedFlakinessDashboard(); | 107 this.src = ui.urlForEmbeddedFlakinessDashboard(); |
| 106 this.addEventListener('load', function() { | 108 this.addEventListener('load', function() { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 resizeHandle.className = 'resize-handle'; | 173 resizeHandle.className = 'resize-handle'; |
| 172 this.appendChild(resizeHandle); | 174 this.appendChild(resizeHandle); |
| 173 | 175 |
| 174 resizeHandle.addEventListener('mousedown', function(event) { | 176 resizeHandle.addEventListener('mousedown', function(event) { |
| 175 this._is_resizing = true; | 177 this._is_resizing = true; |
| 176 event.preventDefault(); | 178 event.preventDefault(); |
| 177 }.bind(this)); | 179 }.bind(this)); |
| 178 | 180 |
| 179 var cancelResize = function(event) { this._is_resizing = false; }.bind(t his); | 181 var cancelResize = function(event) { this._is_resizing = false; }.bind(t his); |
| 180 this.addEventListener('mouseup', cancelResize); | 182 this.addEventListener('mouseup', cancelResize); |
| 181 // FIXME: Use addEventListener once WebKit adds support for mouseleave/m ouseenter. | 183 document.body.addEventListener('mouseleave', cancelResize); |
|
abarth-chromium
2014/06/30 04:26:03
Did that happen?
ojan
2014/06/30 04:49:59
As best I can tell it did. I tested it in plexode
| |
| 182 $(window).bind('mouseleave', cancelResize); | |
| 183 | 184 |
| 184 this.addEventListener('mousemove', function(event) { | 185 this.addEventListener('mousemove', function(event) { |
| 185 if (!this._is_resizing) | 186 if (!this._is_resizing) |
| 186 return; | 187 return; |
| 187 var mouseY = event.clientY + document.body.scrollTop - this.offsetTo p; | 188 var mouseY = event.clientY + document.body.scrollTop - this.offsetTo p; |
| 188 var percentage = 100 * mouseY / this.offsetHeight; | 189 var percentage = 100 * mouseY / this.offsetHeight; |
| 189 document.querySelector('.top-panel').style.maxHeight = percentage + '%'; | 190 document.querySelector('.top-panel').style.maxHeight = percentage + '%'; |
| 190 }.bind(this)) | 191 }.bind(this)) |
| 191 }, | 192 }, |
| 192 _showResults: function(header, scrollInfoView) | 193 _showResults: function(header, scrollInfoView) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 { | 263 { |
| 263 this.className = 'builder-selector'; | 264 this.className = 'builder-selector'; |
| 264 this._delegate = delegate; | 265 this._delegate = delegate; |
| 265 | 266 |
| 266 var tabStrip = this.appendChild(document.createElement('ul')); | 267 var tabStrip = this.appendChild(document.createElement('ul')); |
| 267 | 268 |
| 268 Object.keys(resultsByBuilder).sort().forEach(function(builderName) { | 269 Object.keys(resultsByBuilder).sort().forEach(function(builderName) { |
| 269 var builderHash = base.underscoredBuilderName(builderName); | 270 var builderHash = base.underscoredBuilderName(builderName); |
| 270 | 271 |
| 271 var link = document.createElement('a'); | 272 var link = document.createElement('a'); |
| 272 $(link).attr('href', "#" + builderHash).text(ui.displayNameForBuilde r(builderName)); | 273 link.href = "#" + builderHash; |
| 274 link.textContent = ui.displayNameForBuilder(builderName); | |
| 273 tabStrip.appendChild(document.createElement('li')).appendChild(link) ; | 275 tabStrip.appendChild(document.createElement('li')).appendChild(link) ; |
| 274 | 276 |
| 275 var content = this._delegate.contentForTestAndBuilder(testName, buil derName); | 277 var content = this._delegate.contentForTestAndBuilder(testName, buil derName); |
| 276 content.id = builderHash; | 278 content.id = builderHash; |
| 277 this.appendChild(content); | 279 this.appendChild(content); |
| 278 }, this); | 280 }, this); |
| 279 | 281 |
| 280 $(this).tabs(); | 282 $(this).tabs(); |
| 281 }, | 283 }, |
| 282 nextResult: function() | 284 nextResult: function() |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 }); | 322 }); |
| 321 return builderSelector; | 323 return builderSelector; |
| 322 }, | 324 }, |
| 323 contentForTestAndBuilder: function(testName, builderName) | 325 contentForTestAndBuilder: function(testName, builderName) |
| 324 { | 326 { |
| 325 var failureInfo = results.failureInfoForTestAndBuilder(this._resultsByTe st, testName, builderName); | 327 var failureInfo = results.failureInfoForTestAndBuilder(this._resultsByTe st, testName, builderName); |
| 326 return new ui.results.ResultsDetails(this, failureInfo); | 328 return new ui.results.ResultsDetails(this, failureInfo); |
| 327 }, | 329 }, |
| 328 setResultsByTest: function(resultsByTest) | 330 setResultsByTest: function(resultsByTest) |
| 329 { | 331 { |
| 330 $(this).empty(); | 332 this.innerHTML = ''; |
| 331 this._resultsByTest = resultsByTest; | 333 this._resultsByTest = resultsByTest; |
| 332 this._testSelector = new ui.results.TestSelector(this, resultsByTest); | 334 this._testSelector = new ui.results.TestSelector(this, resultsByTest); |
| 333 this.appendChild(this._testSelector); | 335 this.appendChild(this._testSelector); |
| 334 }, | 336 }, |
| 335 fetchResultsURLs: function(failureInfo) | 337 fetchResultsURLs: function(failureInfo) |
| 336 { | 338 { |
| 337 return this._delegate.fetchResultsURLs(failureInfo); | 339 return this._delegate.fetchResultsURLs(failureInfo); |
| 338 }, | 340 }, |
| 339 nextResult: function() | 341 nextResult: function() |
| 340 { | 342 { |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 356 { | 358 { |
| 357 this._testSelector.firstResult() | 359 this._testSelector.firstResult() |
| 358 }, | 360 }, |
| 359 currentTestName: function() | 361 currentTestName: function() |
| 360 { | 362 { |
| 361 return this._testSelector.currentTestName() | 363 return this._testSelector.currentTestName() |
| 362 } | 364 } |
| 363 }); | 365 }); |
| 364 | 366 |
| 365 })(); | 367 })(); |
| OLD | NEW |