Diff
Modified: trunk/LayoutTests/ChangeLog (122862 => 122863)
--- trunk/LayoutTests/ChangeLog 2012-07-17 18:27:16 UTC (rev 122862)
+++ trunk/LayoutTests/ChangeLog 2012-07-17 18:42:15 UTC (rev 122863)
@@ -1,3 +1,18 @@
+2012-07-17 Ojan Vafai <[email protected]>
+
+ results.html doesn't hide the right data when not showing expected failures
+ https://bugs.webkit.org/show_bug.cgi?id=90889
+
+ Reviewed by Dirk Pranke.
+
+ -Properly hide test lists that have no unexpected items.
+ -Show the correct counts of tests in each test list when only showing unexpected.
+ -Always show tests with stderr output.
+ -Put tests with expected crash/timeout in the crash/timeout lists.
+
+ * fast/harness/resources/results-test.js:
+ * fast/harness/results.html:
+
2012-07-17 Tony Chang <[email protected]>
[chromium] Unreviewed, remove timeout lines for tests on snowleopard that no longer apply.
Modified: trunk/LayoutTests/fast/harness/resources/results-test.js (122862 => 122863)
--- trunk/LayoutTests/fast/harness/resources/results-test.js 2012-07-17 18:27:16 UTC (rev 122862)
+++ trunk/LayoutTests/fast/harness/resources/results-test.js 2012-07-17 18:42:15 UTC (rev 122863)
@@ -495,15 +495,15 @@
var testLinks = document.querySelectorAll('.test-link');
assertTrue(testLinks[0].innerText == 'foo/expected-to-pass-or-crash-and-crashed.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[0], 'tbody', 'expected'));
- assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[0], 'table', 'expected'));
+ assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[0], 'div', 'expected'));
assertTrue(testLinks[1].innerText == 'foo/expected-to-pass-or-timeout-and-timeouted.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[1], 'tbody', 'expected'));
- assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[1], 'table', 'expected'));
+ assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[1], 'div', 'expected'));
assertTrue(testLinks[2].innerText == 'foo/expected-pass-or-fail-and-passed.html');
assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[2], 'tbody', 'expected'));
- assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[2], 'table', 'expected'));
+ assertTrue(enclosingNodeWithTagNameHasClassName(testLinks[2], 'div', 'expected'));
});
results = mockResults();
@@ -676,15 +676,30 @@
subtree['bar-3.html'] = mockExpectation('PASS', 'TEXT');
subtree['bar-4.html'] = mockExpectation('TEXT', 'TEXT');
subtree['bar-5.html'] = mockExpectation('TEXT', 'IMAGE+TEXT');
+ subtree['bar-stderr-expected.html'] = mockExpectation('IMAGE', 'IMAGE');
+ subtree['bar-stderr-expected.html'].has_stderr = true;
+ subtree['bar-expected-timeout.html'] = mockExpectation('TIMEOUT', 'TIMEOUT');
+ subtree['bar-expected-crash.html'] = mockExpectation('CRASH', 'CRASH');
subtree['bar-missing.html'] = mockExpectation('TEXT', 'MISSING');
subtree['bar-missing.html'].is_missing_text = true;
runTest(results, function() {
var titles = document.getElementsByTagName('h1');
assertTrue(titles[0].textContent == 'Tests that crashed (1):');
assertTrue(titles[1].textContent == 'Tests where results did not match expected results (3):');
- assertTrue(titles[2].textContent =='Tests that had no expected results (probably new) (1):');
- assertTrue(titles[3].textContent =='Tests expected to fail but passed (1):');
- logPass('PASS');
+ assertTrue(titles[2].textContent == 'Tests that had no expected results (probably new) (1):');
+ assertTrue(titles[3].textContent == 'Tests that timed out (0):');
+ assertTrue(titles[4].textContent == 'Tests that had stderr output (1):');
+ assertTrue(titles[5].textContent == 'Tests expected to fail but passed (1):');
+
+ document.getElementById('unexpected-results').checked = false;
+ document.getElementById('unexpected-results').onchange();
+
+ assertTrue(titles[0].textContent == 'Tests that crashed (2):');
+ assertTrue(titles[1].textContent == 'Tests where results did not match expected results (5):');
+ assertTrue(titles[2].textContent == 'Tests that had no expected results (probably new) (1):');
+ assertTrue(titles[3].textContent == 'Tests that timed out (1):');
+ assertTrue(titles[4].textContent == 'Tests that had stderr output (1):');
+ assertTrue(titles[5].textContent == 'Tests expected to fail but passed (1):');
});
document.body.innerHTML = '<pre>' + g_log.join('\n') + '</pre>';
Modified: trunk/LayoutTests/fast/harness/results-expected.txt (122862 => 122863)
--- trunk/LayoutTests/fast/harness/results-expected.txt 2012-07-17 18:27:16 UTC (rev 122862)
+++ trunk/LayoutTests/fast/harness/results-expected.txt 2012-07-17 18:42:15 UTC (rev 122863)
@@ -210,3 +210,10 @@
TEST-37: PASS
TEST-37: PASS
TEST-37: PASS
+TEST-37: PASS
+TEST-37: PASS
+TEST-37: PASS
+TEST-37: PASS
+TEST-37: PASS
+TEST-37: PASS
+TEST-37: PASS
Modified: trunk/LayoutTests/fast/harness/results.html (122862 => 122863)
--- trunk/LayoutTests/fast/harness/results.html 2012-07-17 18:27:16 UTC (rev 122862)
+++ trunk/LayoutTests/fast/harness/results.html 2012-07-17 18:42:15 UTC (rev 122863)
@@ -487,12 +487,12 @@
return;
}
- if (actual == 'CRASH' && expected != 'CRASH') {
+ if (actual == 'CRASH') {
globalState().crashTests.push(testObject);
return;
}
- if (actual == 'TIMEOUT' && expected != 'TIMEOUT') {
+ if (actual == 'TIMEOUT') {
globalState().timeoutTests.push(testObject);
return;
}
@@ -629,14 +629,31 @@
return tests.some(function (test) { return !test.isExpected; });
}
+function updateTestlistCounts()
+{
+ forEach(document.querySelectorAll('.test-list-count'), function(count) {
+ var container = parentOfType(count, 'div');
+ var testContainers;
+ if (onlyShowUnexpectedFailures())
+ testContainers = container.querySelectorAll('tbody:not(.expected)');
+ else
+ testContainers = container.querySelectorAll('tbody');
+
+ count.textContent = testContainers.length;
+ })
+}
+
+function testListHeaderHtml(header)
+{
+ return '<h1>' + header + ' (<span class=test-list-count></span>):</h1>';
+}
+
function testList(tests, header, tableId)
{
tests.sort();
- var html = '<h1>' + header + ' (' + tests.length + '):</h1><table id="' + tableId + '"';
- if (!hasUnexpected(tests))
- html += ' class=expected';
- html += '>';
+ var html = '<div' + ((!hasUnexpected(tests) && tableId != 'stderr-table') ? ' class=expected' : '') + ' id=' + tableId + '>' +
+ testListHeaderHtml(header) + '<table>';
// FIXME: add the expected failure column for all the test lists if globalState().results.uses_expectations_file
if (tableId == 'passes-table')
@@ -647,7 +664,7 @@
var test = testObject.name;
html += '<tbody';
if (globalState().results.uses_expectations_file)
- html += ' class="' + (testObject.isExpected ? 'expected' : '') + '"';
+ html += ' class="' + ((testObject.isExpected && tableId != 'stderr-table') ? 'expected' : '') + '"';
html += '><tr><td>';
html += (tableId == 'passes-table') ? testLink(test) : testLinkWithExpandButton(test);
html += '</td><td>';
@@ -665,7 +682,7 @@
html += '</td></tr></tbody>';
}
- html += '</table>';
+ html += '</table></div>';
return html;
}
@@ -1088,6 +1105,7 @@
document.getElementById('unexpected-style').textContent = onlyShowUnexpectedFailures() ?
'.expected { display: none; }' : '';
+ updateTestlistCounts();
TestNavigator.onlyShowUnexpectedFailuresChanged();
}
@@ -1217,7 +1235,7 @@
if (!hasUnexpected(tests))
header += ' class=expected';
- header += '><h1>' + title + ' (' + numberofUnexpectedFailures + '):</h1>' +
+ header += '>' + testListHeaderHtml(title) +
'<table id="' + id + '"><thead><tr>' +
'<th>test</th>' +
'<th id="text-results-header">results</th>' +
@@ -1295,6 +1313,8 @@
}
}
+ updateTestlistCounts();
+
TestNavigator.reset();
OptionWriter.apply();
}