Changeset 84267 in webkit


Ignore:
Timestamp:
Apr 19, 2011 11:12:16 AM (13 years ago)
Author:
ojan@chromium.org
Message:

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

Reviewed by Eric Seidel.

make results file work with audio and reftests
https://bugs.webkit.org/show_bug.cgi?id=58860

Also fix bug with timeout tests and store a bit in the JSON
for new image tests instead of loading the image result to check if it's there.

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

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84262 r84267  
     12011-04-18  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        make results file work with audio and reftests
     6        https://bugs.webkit.org/show_bug.cgi?id=58860
     7
     8        Also fix bug with timeout tests and store a bit in the JSON
     9        for new image tests instead of loading the image result to check if it's there.
     10
     11        * Scripts/webkitpy/layout_tests/layout_package/json_results.html:
     12        * Scripts/webkitpy/layout_tests/layout_package/test_runner.py:
     13
    1142011-04-19  Jer Noble  <jer.noble@apple.com>
    215
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results.html

    r84195 r84267  
    152152function appendResultIframe(src, parent)
    153153{
     154    // FIXME: use audio tags for AUDIO tests?
    154155    var layoutTestsIndex = src.indexOf('LayoutTests');
    155156    var name;
     
    259260  if (actual == 'CRASH')
    260261      row += resultLink(test_prefix, '-stack.txt', 'stack');
    261   else if (actual.indexOf('TEXT' || actual == 'TIMEOUT') != -1) {
     262  else if (actual == 'AUDIO') {
     263      row += resultLink(test_prefix, '-expected.wav', 'expected');
     264      row += resultLink(test_prefix, '-actual.wav', 'actual');
     265  } else if (actual.indexOf('TEXT') != -1 || actual == 'TIMEOUT') {
    262266      // FIXME: only include timeout actual/expected results here if we actually spit out results for timeout tests.
    263267      hasTextFailures = true;
     
    277281  if (actual.indexOf('IMAGE') != -1) {
    278282      hasImageFailures = true;
    279       row += resultLink(test_prefix, '-expected.png', 'expected') +
    280           resultLink(test_prefix, '-actual.png', 'actual') +
    281           resultLink(test_prefix, '-diff.png', 'diff');
     283
     284      if (results.tests[test].is_mismatch_reftest) {
     285          row += resultLink(test_prefix, '-expected-mismatch.html', 'ref mismatch html') +
     286              resultLink(test_prefix, '-actual.png', 'actual');
     287      } else {
     288          if (results.tests[test].is_reftest)
     289              row += resultLink(test_prefix, '-expected.html', 'ref html');
     290
     291          row += resultLink(test_prefix, '-expected.png', 'expected') +
     292              resultLink(test_prefix, '-actual.png', 'actual') +
     293              resultLink(test_prefix, '-diff.png', 'diff');
     294      }
    282295  }
    283296
     
    301314    for (var i = 0; i < tests.length; i++) {
    302315        var test = tests[i];
    303         html += '<tbody><tr><td>' + testLink(test) + '</td>' +
    304             '<td>' + resultLink(stripExtension(test), fileSuffix, linkName) + '</td>';
     316        html += '<tbody><tr><td>' + testLink(test) + '</td><td>';
    305317       
    306         if (fileSuffix.indexOf('actual') != -1)
    307             html += '<td class="image-result-link">' + resultLink(stripExtension(test), '-actual.png', 'png result') + '</td>';
     318        if (fileSuffix.indexOf('actual') == -1)
     319            html += resultLink(stripExtension(test), fileSuffix, linkName);
     320        else {
     321            if (results.tests[test].is_missing_audio)
     322                html += resultLink(stripExtension(test), '-actual.wav', 'audio result');
     323            else {
     324                html += resultLink(stripExtension(test), fileSuffix, linkName);
     325                if (results.tests[test].is_missing_image)
     326                    html += resultLink(stripExtension(test), '-actual.png', 'png result');
     327            }
     328        }
    308329       
    309         html += '</tr></tbody>';
     330        html += '</td></tr></tbody>';
    310331    }
    311332    html += '</table>'
     
    324345
    325346document.write(html);
    326 
    327 function resultLinkErrorHandlerFunction(link)
    328 {
    329     return function() { link.parentNode.removeChild(link); };
    330 }
    331 
    332 function removeNonExistantNewPixelResults()
    333 {
    334     var imageResultLinks = document.querySelectorAll('#new-tests-table .image-result-link');
    335     for (var i = 0, len = imageResultLinks.length; i < len; i++) {
    336         var resultLink = imageResultLinks[i];
    337         var img = new Image();
    338         img.onerror = resultLinkErrorHandlerFunction(resultLink);
    339         img.src = resultLink.querySelector('a').href;
    340     }
    341 }
    342 
    343 removeNonExistantNewPixelResults();
    344347
    345348function toArray(nodeList)
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/test_runner.py

    r84210 r84267  
    144144        tests[test]['expected'] = expected
    145145        tests[test]['actual'] = " ".join(actual)
    146         # FIXME: Set this correctly once https://webkit.org/b/37739 is fixed.
     146        # FIXME: Set this correctly once https://webkit.org/b/37739 is fixed
     147        # and only set it if there actually is stderr data.
    147148        tests[test]['has_stderr'] = False
     149
     150        for f in result.failures:
     151            print f.message()
     152
     153        failure_types = [type(f) for f in result.failures]
     154        if test_failures.FailureMissingAudio in failure_types:
     155            tests[test]['is_missing_audio'] = True
     156
     157        if test_failures.FailureReftestMismatch in failure_types:
     158            tests[test]['is_reftest'] = True
     159
     160        if test_failures.FailureReftestMismatchDidNotOccur in failure_types:
     161            tests[test]['is_mismatch_reftest'] = True
     162
     163        if test_failures.FailureMissingImage in failure_types or test_failures.FailureMissingImageHash in failure_types:
     164            tests[test]['is_missing_image'] = True
    148165
    149166        if filename in test_timings_map:
Note: See TracChangeset for help on using the changeset viewer.