Commit 968c85ea authored by ojan@chromium.org's avatar ojan@chromium.org

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:

git-svn-id: svn://svn.chromium.org/blink/trunk@84267 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a3ab341b
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:
2011-04-19 Jer Noble <jer.noble@apple.com>
Reviewed by Adam Roben.
......
......@@ -151,6 +151,7 @@ function parentOfType(node, selector)
function appendResultIframe(src, parent)
{
// FIXME: use audio tags for AUDIO tests?
var layoutTestsIndex = src.indexOf('LayoutTests');
var name;
if (layoutTestsIndex != -1) {
......@@ -258,7 +259,10 @@ for (var test in results.tests) {
row += '<td>';
if (actual == 'CRASH')
row += resultLink(test_prefix, '-stack.txt', 'stack');
else if (actual.indexOf('TEXT' || actual == 'TIMEOUT') != -1) {
else if (actual == 'AUDIO') {
row += resultLink(test_prefix, '-expected.wav', 'expected');
row += resultLink(test_prefix, '-actual.wav', 'actual');
} else if (actual.indexOf('TEXT') != -1 || actual == 'TIMEOUT') {
// FIXME: only include timeout actual/expected results here if we actually spit out results for timeout tests.
hasTextFailures = true;
row += resultLink(test_prefix, '-expected.txt', 'expected') +
......@@ -276,9 +280,18 @@ for (var test in results.tests) {
if (actual.indexOf('IMAGE') != -1) {
hasImageFailures = true;
row += resultLink(test_prefix, '-expected.png', 'expected') +
resultLink(test_prefix, '-actual.png', 'actual') +
resultLink(test_prefix, '-diff.png', 'diff');
if (results.tests[test].is_mismatch_reftest) {
row += resultLink(test_prefix, '-expected-mismatch.html', 'ref mismatch html') +
resultLink(test_prefix, '-actual.png', 'actual');
} else {
if (results.tests[test].is_reftest)
row += resultLink(test_prefix, '-expected.html', 'ref html');
row += resultLink(test_prefix, '-expected.png', 'expected') +
resultLink(test_prefix, '-actual.png', 'actual') +
resultLink(test_prefix, '-diff.png', 'diff');
}
}
row += '</td>';
......@@ -300,13 +313,21 @@ function appendTestList(tests, header, tableId, fileSuffix, linkName)
html += '<p>' + header + '</p><table id="' + tableId + '">';
for (var i = 0; i < tests.length; i++) {
var test = tests[i];
html += '<tbody><tr><td>' + testLink(test) + '</td>' +
'<td>' + resultLink(stripExtension(test), fileSuffix, linkName) + '</td>';
html += '<tbody><tr><td>' + testLink(test) + '</td><td>';
if (fileSuffix.indexOf('actual') != -1)
html += '<td class="image-result-link">' + resultLink(stripExtension(test), '-actual.png', 'png result') + '</td>';
if (fileSuffix.indexOf('actual') == -1)
html += resultLink(stripExtension(test), fileSuffix, linkName);
else {
if (results.tests[test].is_missing_audio)
html += resultLink(stripExtension(test), '-actual.wav', 'audio result');
else {
html += resultLink(stripExtension(test), fileSuffix, linkName);
if (results.tests[test].is_missing_image)
html += resultLink(stripExtension(test), '-actual.png', 'png result');
}
}
html += '</tr></tbody>';
html += '</td></tr></tbody>';
}
html += '</table>'
}
......@@ -324,24 +345,6 @@ if (hasHttpTests) {
document.write(html);
function resultLinkErrorHandlerFunction(link)
{
return function() { link.parentNode.removeChild(link); };
}
function removeNonExistantNewPixelResults()
{
var imageResultLinks = document.querySelectorAll('#new-tests-table .image-result-link');
for (var i = 0, len = imageResultLinks.length; i < len; i++) {
var resultLink = imageResultLinks[i];
var img = new Image();
img.onerror = resultLinkErrorHandlerFunction(resultLink);
img.src = resultLink.querySelector('a').href;
}
}
removeNonExistantNewPixelResults();
function toArray(nodeList)
{
return Array.prototype.slice.call(nodeList);
......
......@@ -143,9 +143,26 @@ def summarize_results(port_obj, expectations, result_summary, retry_summary, tes
tests[test] = {}
tests[test]['expected'] = expected
tests[test]['actual'] = " ".join(actual)
# FIXME: Set this correctly once https://webkit.org/b/37739 is fixed.
# FIXME: Set this correctly once https://webkit.org/b/37739 is fixed
# and only set it if there actually is stderr data.
tests[test]['has_stderr'] = False
for f in result.failures:
print f.message()
failure_types = [type(f) for f in result.failures]
if test_failures.FailureMissingAudio in failure_types:
tests[test]['is_missing_audio'] = True
if test_failures.FailureReftestMismatch in failure_types:
tests[test]['is_reftest'] = True
if test_failures.FailureReftestMismatchDidNotOccur in failure_types:
tests[test]['is_mismatch_reftest'] = True
if test_failures.FailureMissingImage in failure_types or test_failures.FailureMissingImageHash in failure_types:
tests[test]['is_missing_image'] = True
if filename in test_timings_map:
time_seconds = test_timings_map[filename]
tests[test]['time_ms'] = int(1000 * time_seconds)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment