Changeset 85809 in webkit


Ignore:
Timestamp:
May 4, 2011 4:56:38 PM (13 years ago)
Author:
ojan@chromium.org
Message:

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

Reviewed by Eric Seidel.

[results.html] Hide the entire table if all failures are expected
https://bugs.webkit.org/show_bug.cgi?id=60225

If in a port that uses expected results and all failures are expected,
hide the table as well as the rows when hiding expected failures.

  • fast/harness/resources/results-test.js:
  • fast/harness/results-expected.txt:
  • fast/harness/results.html:
Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r85807 r85809  
     12011-05-04  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [results.html] Hide the entire table if all failures are expected
     6        https://bugs.webkit.org/show_bug.cgi?id=60225
     7
     8        If in a port that uses expected results and all failures are expected,
     9        hide the table as well as the rows when hiding expected failures.
     10
     11        * fast/harness/resources/results-test.js:
     12        * fast/harness/results-expected.txt:
     13        * fast/harness/results.html:
     14
    1152011-05-04  Mark Pilgrim  <pilgrim@chromium.org>
    216
  • trunk/LayoutTests/fast/harness/resources/results-test.js

    r85798 r85809  
    239239        assertTrue(window.getComputedStyle(document.querySelectorAll('tbody')[0], null)['display'] != 'none');
    240240    });
     241   
     242    results = mockResults();
     243    results.tests['only-expected-fail.html'] = mockExpectation('TEXT', 'TEXT');
     244    runTest(results, function() {
     245        assertTrue(window.getComputedStyle(document.getElementById('results-table').parentNode, null)['display'] == 'none');
     246    });
    241247
    242248    runDefaultSingleRowTest('bar-skip.html', 'TEXT', 'SKIP', true, '', '');
     
    304310    results.uses_expectations_file = false;
    305311    runTest(results, function() {
     312        assertTrue(window.getComputedStyle(document.getElementById('results-table').parentNode, null)['display'] != 'none');
    306313        assertTrue(document.querySelectorAll('#results-table tbody td').length == 3);
    307314        assertTrue(!document.querySelector('tbody.expected'));
  • trunk/LayoutTests/fast/harness/results-expected.txt

    r85798 r85809  
    4646TEST-6: PASS
    4747TEST-7: PASS
    48 TEST-7: PASS
    49 TEST-7: PASS
    50 TEST-7: PASS
    51 TEST-7: PASS
    52 TEST-7: PASS
    5348TEST-8: PASS
    5449TEST-8: PASS
     
    9691TEST-15: PASS
    9792TEST-15: PASS
     93TEST-15: PASS
     94TEST-15: PASS
     95TEST-15: PASS
    9896TEST-16: PASS
    9997TEST-16: PASS
     
    102100TEST-17: PASS
    103101TEST-17: PASS
    104 TEST-17: PASS
     102TEST-18: PASS
     103TEST-18: PASS
    105104TEST-18: PASS
    106105TEST-18: PASS
    107106TEST-19: PASS
    108107TEST-19: PASS
    109 TEST-19: PASS
    110 TEST-19: PASS
     108TEST-20: PASS
     109TEST-20: PASS
     110TEST-20: PASS
    111111TEST-20: PASS
    112112TEST-20: PASS
     
    114114TEST-21: PASS
    115115TEST-22: PASS
     116TEST-22: PASS
    116117TEST-23: PASS
    117 TEST-23: PASS
     118TEST-24: PASS
    118119TEST-24: PASS
    119120TEST-25: PASS
    120121TEST-26: PASS
    121122TEST-27: PASS
    122 TEST-27: PASS
    123 TEST-27: PASS
    124123TEST-28: PASS
    125124TEST-28: PASS
     125TEST-28: PASS
     126TEST-29: PASS
     127TEST-29: PASS
  • trunk/LayoutTests/fast/harness/results.html

    r85798 r85809  
    368368}
    369369
    370 function processGlobalStateFor(testObject)
    371 {
    372     var test = testObject.name;
    373     if (testObject.has_stderr)
    374         globalState().testsWithStderr.push(testObject);
    375 
    376     globalState().hasHttpTests = globalState().hasHttpTests || test.indexOf('http/') == 0;
    377 
    378     var actual = testObject.actual;   
    379     if (actual == 'MISSING') {
    380         // FIXME: make sure that new-run-webkit-tests spits out an -actual.txt file for
    381         // tests with MISSING results.
    382         globalState().newTests.push(testObject);
    383         return;
    384     }
    385 
    386     var expected = testObject.expected || 'PASS';
    387     testObject.isExpected = true;
    388     if (actual != 'SKIP' && globalState().results.uses_expectations_file) {
     370function isFailureExpected(expected, actual)
     371{
     372    var isExpected = true;
     373    if (actual != 'SKIP') {
    389374        var expectedArray = expected.split(' ');
    390375        var actualArray = actual.split(' ');
     
    394379                (expectedArray.indexOf('FAIL') == -1 ||
    395380                 (actualValue != 'IMAGE' && actualValue != 'TEXT' && actualValue != 'IMAGE+TEXT')))
    396                 testObject.isExpected = false;
     381                isExpected = false;
    397382        }
    398383    }
     384    return isExpected;
     385}
     386
     387function processGlobalStateFor(testObject)
     388{
     389    var test = testObject.name;
     390    if (testObject.has_stderr)
     391        globalState().testsWithStderr.push(testObject);
     392
     393    globalState().hasHttpTests = globalState().hasHttpTests || test.indexOf('http/') == 0;
     394
     395    var actual = testObject.actual;   
     396    if (actual == 'MISSING') {
     397        // FIXME: make sure that new-run-webkit-tests spits out an -actual.txt file for
     398        // tests with MISSING results.
     399        globalState().newTests.push(testObject);
     400        return;
     401    }
     402
     403    var expected = testObject.expected || 'PASS';
     404    if (globalState().results.uses_expectations_file)
     405        testObject.isExpected = isFailureExpected(expected, actual);
    399406
    400407    if (actual.indexOf(' ') != -1) {
     
    897904        return '';
    898905
    899     var html = '<p>' + title + ':</p>' +
     906    var tableRowHtml = '';
     907    var hasUnexpected = false;
     908    for (var i = 0; i < tests.length; i++) {
     909        if (!tests[i].isExpected)
     910            hasUnexpected = true;
     911        tableRowHtml += tableRow(tests[i]);
     912    }
     913
     914    var header = '<div';
     915    if (!hasUnexpected)
     916        header += ' class=expected';
     917
     918    header += '><p>' + title + ':</p>' +
    900919        '<table id="' + id + '"><thead><tr>' +
    901920        '<th>test</th>' +
     
    904923
    905924    if (globalState().results.uses_expectations_file)
    906         html += '<th>actual failure</th><th>expected failure</th>';
     925        header += '<th>actual failure</th><th>expected failure</th>';
    907926
    908927    if (id == 'flaky-tests-table')
    909         html += '<th>failures</th>';
    910 
    911     html += '</tr></thead>';
    912 
    913     for (var i = 0; i < tests.length; i++)
    914         html += tableRow(tests[i]);
    915 
    916     return html + '</table>';
     928        header += '<th>failures</th>';
     929
     930    header += '</tr></thead>';
     931
     932
     933    return header + tableRowHtml + '</table></div>';
    917934}
    918935
Note: See TracChangeset for help on using the changeset viewer.