Title: [98031] trunk/LayoutTests
Revision
98031
Author
rn...@webkit.org
Date
2011-10-20 15:48:13 -0700 (Thu, 20 Oct 2011)

Log Message

[nrwt] results.html should differentiate expected missing and unexpected missing
https://bugs.webkit.org/show_bug.cgi?id=70372

Reviewed by Ojan Vafai.

Fixed the bug by moving the code to set isExpected above where we find tests with missing results
in processGlobalStateFor, and replacing testList for the missing results table by failingTestsTable.

Also fixed a bug in updateTogglingImages that was erroneously replacing links to .png files by
links to -diffs.html that don't exist for tests with missing results.

* fast/harness/resources/results-test.js: Added a test.
* fast/harness/results-expected.txt: Rebaselined.
* fast/harness/results.html:
* platform/chromium/fast/harness/results-expected.txt: Rebaselined.
* platform/win/fast/harness/results-expected.txt: Rebaselined.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (98030 => 98031)


--- trunk/LayoutTests/ChangeLog	2011-10-20 22:40:34 UTC (rev 98030)
+++ trunk/LayoutTests/ChangeLog	2011-10-20 22:48:13 UTC (rev 98031)
@@ -1,3 +1,22 @@
+2011-10-19  Ryosuke Niwa  <rn...@webkit.org>
+
+        [nrwt] results.html should differentiate expected missing and unexpected missing
+        https://bugs.webkit.org/show_bug.cgi?id=70372
+
+        Reviewed by Ojan Vafai.
+
+        Fixed the bug by moving the code to set isExpected above where we find tests with missing results
+        in processGlobalStateFor, and replacing testList for the missing results table by failingTestsTable.
+
+        Also fixed a bug in updateTogglingImages that was erroneously replacing links to .png files by
+        links to -diffs.html that don't exist for tests with missing results.
+
+        * fast/harness/resources/results-test.js: Added a test.
+        * fast/harness/results-expected.txt: Rebaselined.
+        * fast/harness/results.html:
+        * platform/chromium/fast/harness/results-expected.txt: Rebaselined.
+        * platform/win/fast/harness/results-expected.txt: Rebaselined.
+
 2011-10-20  Tony Chang  <t...@chromium.org>
 
         fix repaint bugs in new flexbox

Modified: trunk/LayoutTests/fast/harness/resources/results-test.js (98030 => 98031)


--- trunk/LayoutTests/fast/harness/resources/results-test.js	2011-10-20 22:40:34 UTC (rev 98030)
+++ trunk/LayoutTests/fast/harness/resources/results-test.js	2011-10-20 22:48:13 UTC (rev 98031)
@@ -138,10 +138,10 @@
     subtree['bar.html'].is_missing_image = true;
     runTest(results, function() {
         assertTrue(!document.getElementById('results-table'));
-        assertTrue(document.querySelector('#new-tests-table .test-link').textContent == 'foo/bar.html');
-        assertTrue(document.querySelector('#new-tests-table .result-link:nth-child(1)').textContent == 'audio result');
-        assertTrue(document.querySelector('#new-tests-table .result-link:nth-child(2)').textContent == 'result');
-        assertTrue(document.querySelector('#new-tests-table .result-link:nth-child(3)').textContent == 'images');
+        assertTrue(document.querySelector('#missing-table .test-link').textContent == 'foo/bar.html');
+        assertTrue(document.getElementsByClassName('result-link')[0].textContent == 'audio result');
+        assertTrue(document.getElementsByClassName('result-link')[1].textContent == 'result');
+        assertTrue(document.getElementsByClassName('result-link')[2].textContent == 'png result');
     });
 
     results = mockResults();
@@ -509,6 +509,28 @@
         assertTrue(resultText.indexOf('crash.html') < resultText.indexOf('flaky-fail.html'));
     });
 
+    results = mockResults();
+    var subtree = results.tests['foo'] = {}
+    subtree['expected-missing.html'] = mockExpectation('MISSING', 'MISSING');
+    subtree['expected-missing.html'].is_missing_text = true;
+    subtree['expected-missing.html'].is_missing_image = true;
+    subtree['unexpected-missing.html'] = mockExpectation('PASS', 'MISSING');
+    subtree['unexpected-missing.html'].is_missing_text = true;
+    runTest(results, function() {
+        assertTrue(!document.getElementById('results-table'));
+        assertTrue(visibleExpandLinks().length == 1);
+        assertTrue(document.querySelector('#missing-table tbody.expected .test-link').textContent == 'foo/expected-missing.html');
+        assertTrue(document.querySelector('#missing-table tbody.expected').getElementsByClassName('result-link')[0].textContent == 'result');
+        assertTrue(document.querySelector('#missing-table tbody.expected').getElementsByClassName('result-link')[1].textContent == 'png result');
+        assertTrue(document.querySelector('#missing-table tbody:not(.expected) .test-link').textContent == 'foo/unexpected-missing.html');
+        assertTrue(document.querySelector('#missing-table tbody:not(.expected) .result-link').textContent == 'result');
+
+        document.getElementById('unexpected-results').checked = false;
+        document.getElementById('unexpected-results').onchange();
+        expandAllExpectations();
+        assertTrue(visibleExpandLinks().length == 2);
+    });
+
     document.body.innerHTML = '<pre>' + g_log.join('\n') + '</pre>';
 }
 

Modified: trunk/LayoutTests/fast/harness/results-expected.txt (98030 => 98031)


--- trunk/LayoutTests/fast/harness/results-expected.txt	2011-10-20 22:40:34 UTC (rev 98030)
+++ trunk/LayoutTests/fast/harness/results-expected.txt	2011-10-20 22:48:13 UTC (rev 98031)
@@ -155,3 +155,11 @@
 TEST-32: PASS
 TEST-32: PASS
 TEST-32: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS

Modified: trunk/LayoutTests/fast/harness/results.html (98030 => 98031)


--- trunk/LayoutTests/fast/harness/results.html	2011-10-20 22:40:34 UTC (rev 98030)
+++ trunk/LayoutTests/fast/harness/results.html	2011-10-20 22:48:13 UTC (rev 98031)
@@ -179,7 +179,7 @@
             hasHttpTests: false,
             hasImageFailures: false,
             hasTextFailures: false,
-            newTests: [],
+            missingResults: [],
             results: {},
             shouldToggleImages: true,
             nonFlakyFailingTests: [],
@@ -435,17 +435,17 @@
     globalState().hasHttpTests = globalState().hasHttpTests || test.indexOf('http/') == 0;
 
     var actual = testObject.actual;    
+    var expected = testObject.expected || 'PASS';
+    if (globalState().results.uses_expectations_file)
+        testObject.isExpected = isFailureExpected(expected, actual);
+
     if (actual == 'MISSING') {
         // FIXME: make sure that new-run-webkit-tests spits out an -actual.txt file for
         // tests with MISSING results.
-        globalState().newTests.push(testObject);
+        globalState().missingResults.push(testObject);
         return;
     }
 
-    var expected = testObject.expected || 'PASS';
-    if (globalState().results.uses_expectations_file)
-        testObject.isExpected = isFailureExpected(expected, actual);
-
     if (actual.indexOf(' ') != -1) {
         globalState().flakyTests.push(testObject);
         return;
@@ -516,6 +516,7 @@
     row += '<td>';
     
     var actual = testObject.actual;
+    var expected = testObject.expected;
     if (actual.indexOf('TEXT') != -1) {
         globalState().hasTextFailures = true;
         row += textResultLinks(test_prefix);
@@ -526,6 +527,14 @@
         row += resultLink(test_prefix, '-actual.wav', 'actual audio');
     }
 
+    if (actual.indexOf('MISSING') != -1) {
+        expected = '';
+        if (testObject.is_missing_audio)
+            row += resultLink(test_prefix, '-actual.wav', 'audio result');
+        if (testObject.is_missing_text)
+            row += resultLink(test_prefix, '-actual.txt', 'result');
+    }
+
     row += '</td><td>';
 
     if (actual.indexOf('IMAGE') != -1) {
@@ -550,13 +559,19 @@
         }
     }
 
+    if (actual.indexOf('MISSING') != -1) {
+        expected = '';
+        if (testObject.is_missing_image)
+            row += resultLink(test_prefix, '-actual.png', 'png result');
+    }
+
     row += '</td>';
 
     if (globalState().results.uses_expectations_file || actual.indexOf(' ') != -1)
         row += '<td>' + actual + '</td>';
 
     if (globalState().results.uses_expectations_file)
-        row += '<td>' + testObject.expected + '</td>';
+        row += '<td>' + expected + '</td>';
 
     row += '</tr></tbody>';
     return row;
@@ -615,14 +630,7 @@
         else if (tableId == 'timeout-tests-table') {
             // FIXME: only include timeout actual/diff results here if we actually spit out results for timeout tests.
             html += textResultLinks(stripExtension(test));
-        } else if (tableId == 'new-tests-table') {
-            if (testObject.is_missing_audio)
-                html += resultLink(stripExtension(test), '-actual.wav', 'audio result');
-            if (testObject.is_missing_text)
-                html += resultLink(stripExtension(test), '-actual.txt', 'result');
-            if (testObject.is_missing_image)
-                html += resultLink(stripExtension(test), '-actual.png', 'png result');
-        } 
+        }
         
         html += '</td></tr></tbody>';
     }
@@ -928,10 +936,10 @@
     globalState().shouldToggleImages = shouldToggle;
     
     if (shouldToggle) {
-        forEach(document.querySelectorAll('tbody:not([mismatchreftest]) a[href$=".png"]'), convertToTogglingHandler(function(prefix) {
+        forEach(document.querySelectorAll('table:not(#missing-table) tbody:not([mismatchreftest]) a[href$=".png"]'), convertToTogglingHandler(function(prefix) {
             return resultLink(prefix, '-diffs.html', 'images');
         }));
-        forEach(document.querySelectorAll('tbody:not([mismatchreftest]) img[src$=".png"]'), convertToTogglingHandler(togglingImage));
+        forEach(document.querySelectorAll('table:not(#missing-table) tbody:not([mismatchreftest]) img[src$=".png"]'), convertToTogglingHandler(togglingImage));
     } else {
         forEach(document.querySelectorAll('a[href$="-diffs.html"]'), convertToNonTogglingHandler(resultLink));
         forEach(document.querySelectorAll('.animatedImage'), convertToNonTogglingHandler(function (absolutePrefix, suffix) {
@@ -1036,15 +1044,15 @@
     html += failingTestsTable(globalState().nonFlakyFailingTests,
         'Tests where results did not match expected results', 'results-table');
 
+    html += failingTestsTable(globalState().missingResults,
+        'Tests that had no expected results (probably new)', 'missing-table');
+
     html += failingTestsTable(globalState().flakyTests,
         'Flaky tests (failed the first run and got a different result on retry)', 'flaky-tests-table');
 
     if (globalState().timeoutTests.length)
         html += testList(globalState().timeoutTests, 'Tests that timed out', 'timeout-tests-table');
 
-    if (globalState().newTests.length)
-        html += testList(globalState().newTests, 'Tests that had no expected results (probably new)', 'new-tests-table');
-
     if (globalState().testsWithStderr.length)
         html += testList(globalState().testsWithStderr, 'Tests that had stderr output', 'stderr-table');
 

Modified: trunk/LayoutTests/platform/chromium/fast/harness/results-expected.txt (98030 => 98031)


--- trunk/LayoutTests/platform/chromium/fast/harness/results-expected.txt	2011-10-20 22:40:34 UTC (rev 98030)
+++ trunk/LayoutTests/platform/chromium/fast/harness/results-expected.txt	2011-10-20 22:48:13 UTC (rev 98031)
@@ -155,3 +155,11 @@
 TEST-32: PASS
 TEST-32: PASS
 TEST-32: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS

Modified: trunk/LayoutTests/platform/win/fast/harness/results-expected.txt (98030 => 98031)


--- trunk/LayoutTests/platform/win/fast/harness/results-expected.txt	2011-10-20 22:40:34 UTC (rev 98030)
+++ trunk/LayoutTests/platform/win/fast/harness/results-expected.txt	2011-10-20 22:48:13 UTC (rev 98031)
@@ -155,3 +155,11 @@
 TEST-32: PASS 
 TEST-32: PASS 
 TEST-32: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
+TEST-33: PASS
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to