Changeset 84543 in webkit
- Timestamp:
- Apr 21, 2011 1:44:41 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r84540 r84543 1 2011-04-21 Ojan Vafai <ojan@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 only expand visible rows 6 https://bugs.webkit.org/show_bug.cgi?id=59130 7 8 For the chromium port, where there are many expected failures, 9 expanding all of them is quite slow. Only expand the visible ones. 10 This makes the default case. Also, make the expanding async to 11 avoid totally killing the process. 12 13 * Scripts/webkitpy/layout_tests/layout_package/json_results.html: 14 * Scripts/webkitpy/layout_tests/layout_package/json_results_test.js: 15 1 16 2011-04-21 Martin Robinson <mrobinson@igalia.com> 2 17 -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results.html
r84525 r84543 223 223 } 224 224 225 function async(func, args) 226 { 227 setTimeout(function() { func.apply(null, args); }, 100); 228 } 229 230 function visibleExpandLinks() 231 { 232 if (onlyShowUnexpectedFailures()) 233 return document.querySelectorAll('tbody:not(.expected) .expand-button-text'); 234 else 235 return document.querySelectorAll('.expand-button-text'); 236 } 237 225 238 function expandAllExpectations() 226 239 { 227 var expandLinks = document.querySelectorAll('.expand-button-text');240 var expandLinks = visibleExpandLinks(); 228 241 for (var i = 0, len = expandLinks.length; i < len; i++) 229 expandExpectations(expandLinks[i]);242 async(expandExpectations, [expandLinks[i]]); 230 243 } 231 244 232 245 function collapseAllExpectations() 233 246 { 234 var expandLinks = document.querySelectorAll('.expand-button-text');247 var expandLinks = visibleExpandLinks(); 235 248 for (var i = 0, len = expandLinks.length; i < len; i++) 236 collapseExpectations(expandLinks[i]);249 async(collapseExpectations, [expandLinks[i]]); 237 250 } 238 251 … … 539 552 document.addEventListener('mousemove', PixelZoomer.handleMouseMove, false); 540 553 541 function updateExpectedResults()554 function onlyShowUnexpectedFailures() 542 555 { 543 556 var checkBox = document.querySelector('.unexpected-results'); 544 document.getElementById('unexpected-style').innerText = (!checkBox || checkBox.checked) ? 557 return !checkBox || checkBox.checked; 558 } 559 560 function updateExpectedFailures() 561 { 562 document.getElementById('unexpected-style').innerText = onlyShowUnexpectedFailures() ? 545 563 '.expected { display: none; }' : ''; 546 564 } … … 553 571 554 572 if (globalState().results.uses_expectations_file) 555 html += '<label><input class="unexpected-results" type=checkbox checked onchange="updateExpected Results()">Only show unexpected results</label>';573 html += '<label><input class="unexpected-results" type=checkbox checked onchange="updateExpectedFailures()">Only show unexpected results</label>'; 556 574 557 575 html += '</div>'; … … 598 616 } 599 617 600 updateExpected Results();618 updateExpectedFailures(); 601 619 } 602 620 </script> -
trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_test.js
r84525 r84543 5 5 var g_log = ["You should see a serios of PASS lines."]; 6 6 var g_currentTestSucceeded; 7 8 // Make async actually be sync for the sake of simpler testing. 9 function async(func, args) 10 { 11 func.apply(null, args); 12 } 7 13 8 14 function mockResults() … … 149 155 assertTrue(expandLinks[1].textContent == '+'); 150 156 }); 157 158 results = mockResults(); 159 results.tests['foo/bar.html'] = mockExpectation('PASS', 'TEXT'); 160 results.tests['foo/bar-expected-fail.html'] = mockExpectation('TEXT', 'TEXT'); 161 runTest(results, function() { 162 assertTrue(document.querySelectorAll('.expected').length == 1); 163 assertTrue(document.querySelector('.expected .test-link').textContent == 'foo/bar-expected-fail.html'); 164 165 expandAllExpectations(); 166 assertTrue(visibleExpandLinks().length == 1); 167 assertTrue(document.querySelectorAll('.results-row').length == 1); 168 169 document.querySelector('.unexpected-results').checked = false; 170 171 assertTrue(visibleExpandLinks().length == 2); 172 assertTrue(document.querySelectorAll('.results-row').length == 1); 173 174 expandAllExpectations(); 175 assertTrue(document.querySelectorAll('.results-row').length == 2); 176 }); 177 151 178 document.body.innerHTML = '<pre>' + g_log.join('\n') + '</pre>'; 152 179 }
Note: See TracChangeset
for help on using the changeset viewer.