Changeset 94631 in webkit
- Timestamp:
- Sep 6, 2011, 8:41:52 PM (14 years ago)
- Location:
- trunk/Tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/controllers.js
r94580 r94631 34 34 this._resultsByTest = resultsByTest; 35 35 this._view.setResultsByTest(resultsByTest); 36 // FIXME: Wire up some actions. 36 37 $(this._view).bind('next', this.onNext.bind(this)); 38 $(this._view).bind('previous', this.onPrevious.bind(this)); 37 39 }, 40 onNext: function() 41 { 42 this._view.nextResult(); 43 }, 44 onPrevious: function() 45 { 46 this._view.previousResult(); 47 } 38 48 }); 39 49 -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js
r94580 r94631 154 154 var resultsGrid = new ui.results.ResultsGrid(); 155 155 resultsGrid.addResults(resultsURLs); 156 $(this).empty().append(resultsGrid); 156 $(this).empty().append( 157 new ui.actions.List([ 158 new ui.actions.Rebaseline().makeDefault(), 159 new ui.actions.Previous(), 160 new ui.actions.Next() 161 ])).append(resultsGrid); 157 162 }.bind(this)); 158 163 }, … … 164 169 this.className = 'test-selector'; 165 170 this._delegate = delegate; 171 this._length = 0; 166 172 167 173 Object.keys(resultsByTest).forEach(function (testName) { … … 170 176 this.appendChild(document.createElement('h3')).appendChild(link); 171 177 this.appendChild(this._delegate.contentForTest(testName)); 178 ++this._length; // There doesn't seem to be any good way to get this information from accordion. 172 179 }, this); 173 180 … … 176 183 autoHeight: false, 177 184 }); 178 $(this).accordion("activate", false); 185 $(this).accordion('activate', false); 186 }, 187 nextResult: function() 188 { 189 var activeIndex = $(this).accordion('option', 'active'); 190 if ($('.builder-selector', this)[activeIndex].nextResult()) 191 return true; 192 return this.nextTest(); 193 }, 194 previousResult: function() 195 { 196 var activeIndex = $(this).accordion('option', 'active'); 197 if ($('.builder-selector', this)[activeIndex].previousResult()) 198 return true; 199 return this.previousTest(); 200 }, 201 nextTest: function() 202 { 203 var nextIndex = $(this).accordion('option', 'active') + 1; 204 if (nextIndex >= this._length) { 205 $(this).accordion('option', 'active', false); 206 return false; 207 } 208 $(this).accordion('option', 'active', nextIndex); 209 $('.builder-selector', this)[nextIndex].firstResult(); 210 return true; 211 }, 212 previousTest: function() 213 { 214 var previousIndex = $(this).accordion('option', 'active') - 1; 215 if (previousIndex < 0) { 216 $(this).accordion('option', 'active', false); 217 return false; 218 } 219 $(this).accordion('option', 'active', previousIndex); 220 $('.builder-selector', this)[previousIndex].lastResult(); 221 return true; 222 }, 223 firstResult: function() 224 { 225 $(this).accordion('option', 'active', 0); 226 $('.builder-selector', this)[0].firstResult(); 179 227 } 180 228 }); … … 201 249 202 250 $(this).tabs(); 251 }, 252 nextResult: function() 253 { 254 var nextIndex = $(this).tabs('option', 'selected') + 1; 255 if (nextIndex >= $(this).tabs('length')) 256 return false 257 $(this).tabs('option', 'selected', nextIndex); 258 return true; 259 }, 260 previousResult: function() 261 { 262 var previousIndex = $(this).tabs('option', 'selected') - 1; 263 if (previousIndex < 0) 264 return false; 265 $(this).tabs('option', 'selected', previousIndex); 266 return true; 267 }, 268 firstResult: function() 269 { 270 $(this).tabs('option', 'selected', 0); 271 }, 272 lastResult: function() 273 { 274 $(this).tabs('option', 'selected', $(this).tabs('length') - 1); 203 275 } 204 276 }); … … 228 300 $(this).empty(); 229 301 this._resultsByTest = resultsByTest; 230 231 var testSelector = new ui.results.TestSelector(this, resultsByTest); 232 $(testSelector).bind("accordionchangestart", function(event, ui) { 302 this._testSelector = new ui.results.TestSelector(this, resultsByTest); 303 $(this._testSelector).bind("accordionchangestart", function(event, ui) { 233 304 // Prefetch the first results from the network. 234 305 var resultsDetails = $('.results-detail', ui.newContent); … … 242 313 }, kResultsPrefetchDelayMS); 243 314 }); 244 this.appendChild(t estSelector);315 this.appendChild(this._testSelector); 245 316 }, 246 317 fetchResultsURLs: function(failureInfo, callback) 247 318 { 248 319 this._delegate.fetchResultsURLs(failureInfo, callback) 320 }, 321 nextResult: function() 322 { 323 return this._testSelector.nextResult(); 324 }, 325 previousResult: function() 326 { 327 return this._testSelector.previousResult(); 328 }, 329 firstResult: function() 330 { 331 this._testSelector.firstResult() 249 332 } 250 333 }); -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js
r94580 r94631 47 47 } 48 48 49 // FIXME: Add some unit tests. 49 test('View', 6, function() { 50 var delegate = { 51 fetchResultsURLs: function(failureInfo, callback) { return;} 52 }; 53 54 var view = new ui.results.View(delegate); 55 view.setResultsByTest(kExampleResultsByTest); 56 view.firstResult(); 57 58 view.nextResult(); 59 equals($('.test-selector', view).accordion('option', 'active'), 0); 60 equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 1); 61 view.nextResult(); 62 equals($('.test-selector', view).accordion('option', 'active'), 1); 63 equals($($('.builder-selector', view)[1]).tabs('option', 'selected'), 0); 64 view.previousResult(); 65 equals($('.test-selector', view).accordion('option', 'active'), 0); 66 equals($($('.builder-selector', view)[0]).tabs('option', 'selected'), 1); 67 }); 50 68 51 69 })(); -
trunk/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css
r94580 r94631 24 24 */ 25 25 26 .results-view>.toolbar { 27 padding-bottom: 15px; 26 .results-view ul.actions { 27 float: right; 28 margin: 0; 29 padding: 5px 0px; 30 list-style: none; 31 display: inline-block; 28 32 } 29 33 30 .results-view>.toolbar ul.actions { 31 float: right; 32 margin: 0; 33 padding: 0; 34 list-style: none; 35 display: inline-block; 36 } 34 .results-view ul.actions li { 35 display: inline-block; 36 } 37 37 38 .results-view>.toolbar ul.actions li{39 display: inline-block;40 38 .ui-tabs .ui-tabs-panel.results-detail { 39 padding: 0px; 40 } 41 41 42 42 .results-grid table { … … 53 53 .results-grid table th { 54 54 padding: 3px; 55 border-bottom: 1px solid #AAA; 55 border-top: 1px solid #DDD; 56 border-bottom: 1px solid #DDD; 56 57 } 57 58 -
trunk/Tools/ChangeLog
r94618 r94631 1 2011-09-06 Adam Barth <abarth@webkit.org> 2 3 garden-o-matic details view should having working rebaseline and next/previous buttons 4 https://bugs.webkit.org/show_bug.cgi?id=67659 5 6 Reviewed by Dimitri Glazkov. 7 8 This patch wires up basic back/forward buttons that let you traverse 9 through the results we're examining in the details view. This ended up 10 being more code than I expected, but I wanted to keep all the state 11 information in the DOM itself. 12 13 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results.js: 14 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/scripts/ui/results_unittests.js: 15 * BuildSlaveSupport/build.webkit.org-config/public_html/TestFailures/styles/results.css: 16 1 17 2011-09-01 Dirk Pranke <dpranke@chromium.org> 2 18
Note:
See TracChangeset
for help on using the changeset viewer.