Changeset 84543 in webkit


Ignore:
Timestamp:
Apr 21, 2011 1:44:41 PM (13 years ago)
Author:
ojan@chromium.org
Message:

2011-04-21 Ojan Vafai <ojan@chromium.org>

Reviewed by Tony Chang.

only expand visible rows
https://bugs.webkit.org/show_bug.cgi?id=59130

For the chromium port, where there are many expected failures,
expanding all of them is quite slow. Only expand the visible ones.
This makes the default case. Also, make the expanding async to
avoid totally killing the process.

  • Scripts/webkitpy/layout_tests/layout_package/json_results.html:
  • Scripts/webkitpy/layout_tests/layout_package/json_results_test.js:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84540 r84543  
     12011-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
    1162011-04-21  Martin Robinson  <mrobinson@igalia.com>
    217
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results.html

    r84525 r84543  
    223223}
    224224
     225function async(func, args)
     226{
     227    setTimeout(function() { func.apply(null, args); }, 100);
     228}
     229
     230function 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
    225238function expandAllExpectations()
    226239{
    227     var expandLinks = document.querySelectorAll('.expand-button-text');
     240    var expandLinks = visibleExpandLinks();
    228241    for (var i = 0, len = expandLinks.length; i < len; i++)
    229         expandExpectations(expandLinks[i]);
     242        async(expandExpectations, [expandLinks[i]]);
    230243}
    231244
    232245function collapseAllExpectations()
    233246{
    234     var expandLinks = document.querySelectorAll('.expand-button-text');
     247    var expandLinks = visibleExpandLinks();
    235248    for (var i = 0, len = expandLinks.length; i < len; i++)
    236         collapseExpectations(expandLinks[i]);
     249        async(collapseExpectations, [expandLinks[i]]);
    237250}
    238251
     
    539552document.addEventListener('mousemove', PixelZoomer.handleMouseMove, false);
    540553
    541 function updateExpectedResults()
     554function onlyShowUnexpectedFailures()
    542555{
    543556    var checkBox = document.querySelector('.unexpected-results');
    544     document.getElementById('unexpected-style').innerText = (!checkBox || checkBox.checked) ?
     557    return !checkBox || checkBox.checked;
     558}
     559
     560function updateExpectedFailures()
     561{
     562    document.getElementById('unexpected-style').innerText = onlyShowUnexpectedFailures() ?
    545563        '.expected { display: none; }' : '';
    546564}
     
    553571
    554572    if (globalState().results.uses_expectations_file)
    555         html += '<label><input class="unexpected-results" type=checkbox checked onchange="updateExpectedResults()">Only show unexpected results</label>';
     573        html += '<label><input class="unexpected-results" type=checkbox checked onchange="updateExpectedFailures()">Only show unexpected results</label>';
    556574
    557575    html += '</div>';
     
    598616    }
    599617   
    600     updateExpectedResults();
     618    updateExpectedFailures();
    601619}
    602620</script>
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_test.js

    r84525 r84543  
    55var g_log = ["You should see a serios of PASS lines."];
    66var g_currentTestSucceeded;
     7
     8// Make async actually be sync for the sake of simpler testing.
     9function async(func, args)
     10{
     11    func.apply(null, args);
     12}
    713
    814function mockResults()
     
    149155        assertTrue(expandLinks[1].textContent == '+');
    150156    });
     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   
    151178    document.body.innerHTML = '<pre>' + g_log.join('\n') + '</pre>';
    152179}
Note: See TracChangeset for help on using the changeset viewer.