Changeset 64186 in webkit


Ignore:
Timestamp:
Jul 27, 2010 8:44:53 PM (14 years ago)
Author:
dbates@webkit.org
Message:

2010-07-27 Daniel Bates <dbates@rim.com>

Reviewed by Darin Adler.

Convert DRT list tests from pixel-tests/render tree dumps to text
https://bugs.webkit.org/show_bug.cgi?id=42803

With the passing of Bug #37929 and Bug #37930, convert a subset of the
DRT tests for lists from pixel-tests to text-based tests now that we
can retrieve the list item marker text in both the Mac and Windows ports.

  • fast/lists/alpha-boundary-values-expected.txt: Added.
  • fast/lists/alpha-boundary-values.html: Modified to dump as text.
  • fast/lists/alpha-list-wrap-expected.txt: Added.
  • fast/lists/alpha-list-wrap.html: Modified to dump as text.
  • fast/lists/decimal-leading-zero-expected.txt: Added.
  • fast/lists/decimal-leading-zero.html: Modified to dump as text.
  • fast/lists/li-values-expected.txt: Added.
  • fast/lists/li-values.html: Modified to dump as text.
  • fast/lists/list-style-type-dynamic-change-expected.txt: Added.
  • fast/lists/list-style-type-dynamic-change.html: Modified to dump as text.
  • fast/lists/resources/dump-list.js: (dumpList): Modified to call processList. (filterListsWithReplacement): Added. (processList): Added. (dumpListItemAsHTML): Added. (printPassedIfEmptyString): Added. (printFailedIfListItemMarkerNotEqualListItemText): Added.
  • fast/lists/w3-css3-list-styles-alphabetic-expected.txt: Added.
  • fast/lists/w3-css3-list-styles-alphabetic.html: Modified to dump as text.
  • fast/lists/w3-css3-list-styles-numeric-expected.txt: Added.
  • fast/lists/w3-css3-list-styles-numeric.html: Modified to dump as text. Also, fix typos in the binary list-style-type results.
  • fast/lists/w3-list-styles-expected.txt: Added.
  • fast/lists/w3-list-styles.html: Modified to dump as text.
  • platform/mac/fast/lists/alpha-boundary-values-expected.checksum: Removed.
  • platform/mac/fast/lists/alpha-boundary-values-expected.png: Removed.
  • platform/mac/fast/lists/alpha-boundary-values-expected.txt: Removed.
  • platform/mac/fast/lists/alpha-list-wrap-expected.checksum: Removed.
  • platform/mac/fast/lists/alpha-list-wrap-expected.png: Removed.
  • platform/mac/fast/lists/alpha-list-wrap-expected.txt: Removed.
  • platform/mac/fast/lists/decimal-leading-zero-expected.checksum: Removed.
  • platform/mac/fast/lists/decimal-leading-zero-expected.png: Removed.
  • platform/mac/fast/lists/decimal-leading-zero-expected.txt: Removed.
  • platform/mac/fast/lists/li-values-expected.checksum: Removed.
  • platform/mac/fast/lists/li-values-expected.png: Removed.
  • platform/mac/fast/lists/li-values-expected.txt: Removed.
  • platform/mac/fast/lists/list-style-type-dynamic-change-expected.checksum: Removed.
  • platform/mac/fast/lists/list-style-type-dynamic-change-expected.png: Removed.
  • platform/mac/fast/lists/list-style-type-dynamic-change-expected.txt: Removed.
  • platform/mac/fast/lists/w3-css3-list-styles-alphabetic-expected.checksum: Removed.
  • platform/mac/fast/lists/w3-css3-list-styles-alphabetic-expected.png: Removed.
  • platform/mac/fast/lists/w3-css3-list-styles-alphabetic-expected.txt: Removed.
  • platform/mac/fast/lists/w3-css3-list-styles-numeric-expected.checksum: Removed.
  • platform/mac/fast/lists/w3-css3-list-styles-numeric-expected.png: Removed.
  • platform/mac/fast/lists/w3-css3-list-styles-numeric-expected.txt: Removed.
  • platform/mac/fast/lists/w3-list-styles-expected.checksum: Removed.
  • platform/mac/fast/lists/w3-list-styles-expected.png: Removed.
  • platform/mac/fast/lists/w3-list-styles-expected.txt: Removed.
  • platform/win/fast/lists: Removed.
  • platform/win/fast/lists/w3-css3-list-styles-alphabetic-expected.txt: Removed.
  • platform/win/fast/lists/w3-css3-list-styles-numeric-expected.txt: Removed.
Location:
trunk/LayoutTests
Files:
8 added
25 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r64179 r64186  
     12010-07-27  Daniel Bates  <dbates@rim.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Convert DRT list tests from pixel-tests/render tree dumps to text
     6        https://bugs.webkit.org/show_bug.cgi?id=42803
     7
     8        With the passing of Bug #37929 and Bug #37930, convert a subset of the
     9        DRT tests for lists from pixel-tests to text-based tests now that we
     10        can retrieve the list item marker text in both the Mac and Windows ports.
     11
     12        * fast/lists/alpha-boundary-values-expected.txt: Added.
     13        * fast/lists/alpha-boundary-values.html: Modified to dump as text.
     14        * fast/lists/alpha-list-wrap-expected.txt: Added.
     15        * fast/lists/alpha-list-wrap.html: Modified to dump as text.
     16        * fast/lists/decimal-leading-zero-expected.txt: Added.
     17        * fast/lists/decimal-leading-zero.html: Modified to dump as text.
     18        * fast/lists/li-values-expected.txt: Added.
     19        * fast/lists/li-values.html: Modified to dump as text.
     20        * fast/lists/list-style-type-dynamic-change-expected.txt: Added.
     21        * fast/lists/list-style-type-dynamic-change.html: Modified to dump as text.
     22        * fast/lists/resources/dump-list.js:
     23        (dumpList): Modified to call processList.
     24        (filterListsWithReplacement): Added.
     25        (processList): Added.
     26        (dumpListItemAsHTML): Added.
     27        (printPassedIfEmptyString): Added.
     28        (printFailedIfListItemMarkerNotEqualListItemText): Added.
     29        * fast/lists/w3-css3-list-styles-alphabetic-expected.txt: Added.
     30        * fast/lists/w3-css3-list-styles-alphabetic.html: Modified to dump as text.
     31        * fast/lists/w3-css3-list-styles-numeric-expected.txt: Added.
     32        * fast/lists/w3-css3-list-styles-numeric.html: Modified to dump as text.
     33          Also, fix typos in the binary list-style-type results.
     34        * fast/lists/w3-list-styles-expected.txt: Added.
     35        * fast/lists/w3-list-styles.html: Modified to dump as text.
     36        * platform/mac/fast/lists/alpha-boundary-values-expected.checksum: Removed.
     37        * platform/mac/fast/lists/alpha-boundary-values-expected.png: Removed.
     38        * platform/mac/fast/lists/alpha-boundary-values-expected.txt: Removed.
     39        * platform/mac/fast/lists/alpha-list-wrap-expected.checksum: Removed.
     40        * platform/mac/fast/lists/alpha-list-wrap-expected.png: Removed.
     41        * platform/mac/fast/lists/alpha-list-wrap-expected.txt: Removed.
     42        * platform/mac/fast/lists/decimal-leading-zero-expected.checksum: Removed.
     43        * platform/mac/fast/lists/decimal-leading-zero-expected.png: Removed.
     44        * platform/mac/fast/lists/decimal-leading-zero-expected.txt: Removed.
     45        * platform/mac/fast/lists/li-values-expected.checksum: Removed.
     46        * platform/mac/fast/lists/li-values-expected.png: Removed.
     47        * platform/mac/fast/lists/li-values-expected.txt: Removed.
     48        * platform/mac/fast/lists/list-style-type-dynamic-change-expected.checksum: Removed.
     49        * platform/mac/fast/lists/list-style-type-dynamic-change-expected.png: Removed.
     50        * platform/mac/fast/lists/list-style-type-dynamic-change-expected.txt: Removed.
     51        * platform/mac/fast/lists/w3-css3-list-styles-alphabetic-expected.checksum: Removed.
     52        * platform/mac/fast/lists/w3-css3-list-styles-alphabetic-expected.png: Removed.
     53        * platform/mac/fast/lists/w3-css3-list-styles-alphabetic-expected.txt: Removed.
     54        * platform/mac/fast/lists/w3-css3-list-styles-numeric-expected.checksum: Removed.
     55        * platform/mac/fast/lists/w3-css3-list-styles-numeric-expected.png: Removed.
     56        * platform/mac/fast/lists/w3-css3-list-styles-numeric-expected.txt: Removed.
     57        * platform/mac/fast/lists/w3-list-styles-expected.checksum: Removed.
     58        * platform/mac/fast/lists/w3-list-styles-expected.png: Removed.
     59        * platform/mac/fast/lists/w3-list-styles-expected.txt: Removed.
     60        * platform/win/fast/lists: Removed.
     61        * platform/win/fast/lists/w3-css3-list-styles-alphabetic-expected.txt: Removed.
     62        * platform/win/fast/lists/w3-css3-list-styles-numeric-expected.txt: Removed.
     63
    1642010-07-27  Andrew Scherkus  <scherkus@chromium.org>
    265
  • trunk/LayoutTests/fast/lists/alpha-boundary-values.html

    r59950 r64186  
    1717<li value=18280 type=A>
    1818<li value=18281 type=A>
     19</ol>
     20<script src="resources/dump-list.js"></script>
     21<script>
     22    if (window.layoutTestController) {
     23        layoutTestController.dumpAsText();
     24        filterListsWithReplacement(document.querySelectorAll("ol"));
     25    }
     26</script>
  • trunk/LayoutTests/fast/lists/alpha-list-wrap.html

    r14023 r64186  
    88}
    99</script>
     10<script src="resources/dump-list.js"></script>
     11<script>
     12    if (window.layoutTestController) {
     13        layoutTestController.dumpAsText();
     14        filterListsWithReplacement([document.getElementById("test")]);
     15    }
     16</script>
  • trunk/LayoutTests/fast/lists/decimal-leading-zero.html

    r18637 r64186  
    2323<li value="100">this list item should be labeled 100</li>
    2424</ol>
     25<script src="resources/dump-list.js"></script>
     26<script>
     27    if (window.layoutTestController) {
     28        layoutTestController.dumpAsText();
     29        filterListsWithReplacement(document.querySelectorAll("ol"));
     30    }
     31</script>
  • trunk/LayoutTests/fast/lists/li-values.html

    r18637 r64186  
     1<script src="resources/dump-list.js"></script>
    12<script>
    23
     
    45{
    56    document.getElementById("removeMyValue").removeAttribute("value");
     7    filterListsWithReplacement(document.querySelectorAll("ol"));
    68    if (window.layoutTestController)
    79        layoutTestController.notifyDone();
     
    1012function init()
    1113{
    12     if (window.layoutTestController)
     14    if (window.layoutTestController) {
     15        layoutTestController.dumpAsText();
    1316        layoutTestController.waitUntilDone();
     17    }
    1418    setTimeout(finishTest, 0);
    1519}
  • trunk/LayoutTests/fast/lists/list-style-type-dynamic-change.html

    r19875 r64186  
    2020        document.getElementById("list").style.listStyleType = "decimal";
    2121    </script>
     22    <script src="resources/dump-list.js"></script>
     23    <script>
     24        if (window.layoutTestController) {
     25            layoutTestController.dumpAsText();
     26            filterListsWithReplacement([document.getElementById("list")]);
     27        }
     28    </script>
    2229</body>
    2330</html>
  • trunk/LayoutTests/fast/lists/resources/dump-list.js

    r63034 r64186  
    77}
    88
    9 function dumpListHelper(element, depth)
     9function dumpList(list)
    1010{
    11     var list = new String();
    12 
    13     for (var child = element.firstElementChild; child; child = child.nextElementSibling) {
    14         var marker = layoutTestController.markerTextForListItem(child);
    15         if (marker)
    16             list += indent(depth) + ' ' + marker + ' ' + child.innerText.trim() + '<br>';
    17         list += dumpListHelper(child, depth + 1);
    18     }
    19 
    20     return list;
     11    return processList(list, dumpListItemAsHTML, 0);
    2112}
    2213
    23 function dumpList(list)
     14function filterListsWithReplacement(lists, processListItemFunction, postFilterFunction)
    2415{
    25     return dumpListHelper(list, 0);
     16    processListItemFunction = processListItemFunction || dumpListItemAsHTML;
     17    for (var i = 0; i < lists.length; ++i) {
     18        var parentNode = lists[i].parentNode;
     19        var replacementNode = document.createElement("div");
     20        var result = processList(lists[i], processListItemFunction, 0);
     21        replacementNode.innerHTML = postFilterFunction ? postFilterFunction(result) : result;
     22        parentNode.replaceChild(replacementNode, lists[i]);
     23    }
    2624}
     25
     26function processList(element, processListItemFunction, depth)
     27{
     28    var result = "";
     29    for (var child = element.firstElementChild; child; child = child.nextElementSibling) {
     30        result += processListItemFunction(child, depth);
     31        result += processList(child, processListItemFunction, depth + 1);
     32    }
     33    return result;
     34}
     35
     36function dumpListItemAsHTML(listItemElement, depth)
     37{
     38    var marker = layoutTestController.markerTextForListItem(listItemElement);
     39    return marker ? indent(depth) + ' ' + marker + ' ' + listItemElement.innerText.trim() + '<br/>' : '';
     40}
     41
     42function printPassedIfEmptyString(string)
     43{
     44    return string ? string : '<span class="pass">PASS</span><br/>';
     45}
     46
     47function printFailedIfListItemMarkerNotEqualListItemText(listItemElement, depth)
     48{
     49    var marker = layoutTestController.markerTextForListItem(listItemElement);
     50    var expectedMarkerText = listItemElement.innerText.trim();
     51    if (marker === expectedMarkerText)
     52        return '';
     53    return '<span><span class="fail">FAIL</span> list marker should be ' + expectedMarkerText + '. Was ' + marker + '.</span><br/>';
     54}
  • trunk/LayoutTests/fast/lists/w3-css3-list-styles-alphabetic.html

    r60899 r64186  
    8080        ol.upper-norwegian { list-style-type: upper-norwegian; }
    8181    </style>
     82    <script src="resources/dump-list.js"></script>
     83    <script>
     84        function runTest()
     85        {
     86            if (!window.layoutTestController)
     87                return;
     88               
     89            layoutTestController.dumpAsText();
     90            filterListsWithReplacement(document.querySelectorAll(".test ol"), printFailedIfListItemMarkerNotEqualListItemText, printPassedIfEmptyString);
     91            document.body.removeChild(document.getElementById("description")); // Remove description when running in DRT.
     92        }
     93        window.onload = runTest;
     94    </script>
    8295</head>
    8396<body>
    8497    <h1>CSS3 Alphabetic list-style-types</h1>
     98    <div id="description">
    8599    <p>This tests that all of the alphabetic CSS3 list-style-types are supported as per <a href="http://www.w3.org/TR/css3-lists/#alphabetic">section 4.4 of the spec. CSS3 Lists module</a> (Draft 7 November 2002). This test PASSED if the list item matches its bullet for every list item (below). For example, for the upper-greek alphabet the third &lt;li&gt; (which corresponds to Gamma in the lexicographic ordering of the upper greek alphabet) should be rendered as: &#x0393;&#x0002E; &#x0393;.</p>
    86100    <p>Note, some list-style-types may use a suffix other than a  dot ('.').</p>
     101    </div>
    87102    <div class="test">
    88103        <h2>afar</h2>
  • trunk/LayoutTests/fast/lists/w3-css3-list-styles-numeric.html

    r54472 r64186  
    5959        ol.upper-hexadecimal { list-style-type: upper-hexadecimal; }
    6060    </style>
     61    <script src="resources/dump-list.js"></script>
     62    <script>
     63        function printFailedIfListItemMarkerNotEqualListItemText(listItemElement, depth)
     64        {
     65            var marker = layoutTestController.markerTextForListItem(listItemElement);
     66            var isNegativeNumber = listItemElement.parentNode.className && listItemElement.parentNode.className.split(" ").indexOf("negative-number") > -1;
     67            var expectedMarkerText = isNegativeNumber ? "-" : "";
     68            expectedMarkerText += listItemElement.innerText;
     69            if (marker === expectedMarkerText)
     70                return '';
     71            return '<span><span class="fail">FAIL</span> list marker should be ' + expectedMarkerText + '. Was ' + marker + '.</span><br/>';
     72        }
     73
     74        function runTest()
     75        {
     76            if (!window.layoutTestController)
     77                return;
     78           
     79            layoutTestController.dumpAsText();
     80            filterListsWithReplacement(document.querySelectorAll(".test ol"), printFailedIfListItemMarkerNotEqualListItemText, printPassedIfEmptyString);
     81            document.body.removeChild(document.getElementById("description")); // Remove description when running in DRT.
     82        }
     83        window.onload = runTest;
     84    </script>
    6185</head>
    6286<body>
    6387    <h1>CSS3 Numeric list-style-type</h1>
    64     <p>This tests that all of the numeric CSS3 list-style-types are supported as per <a href="http://www.w3.org/TR/css3-lists/#numeric">section 4.3 of the spec. CSS3 Lists module</a> (Draft 7 November 2002). This test PASSED if the list item matches its bullet for every list item (below). For example, for the decimal numeric system the second &lt;li&gt; (which corresponds to 2 in the standard ordering of the positive integers) should be rendered as: 2. 2</p>
     88    <p id="description">This tests that all of the numeric CSS3 list-style-types are supported as per <a href="http://www.w3.org/TR/css3-lists/#numeric">section 4.3 of the spec. CSS3 Lists module</a> (Draft 7 November 2002). This test PASSED if the list item matches its bullet for every list item (below). For example, for the decimal numeric system the second &lt;li&gt; (which corresponds to 2 in the standard ordering of the positive integers) should be rendered as: 2. 2</p>
    6589    <div class="test">
    6690        <h2>arabic-indic</h2>
     
    96120        </ol>
    97121        <ol class="binary negative-number" start="-2147483648">
    98             <li>1000000000000000000000000000000</li>
    99             <li>111111111111111111111111111111</li>
     122            <li>10000000000000000000000000000000</li>
     123            <li>1111111111111111111111111111111</li>
    100124        </ol>
    101125    </div>
  • trunk/LayoutTests/fast/lists/w3-list-styles.html

    r18679 r64186  
    2020ol ol { margin-bottom: 0em; margin-top: 0.5em; }
    2121</style>
     22<script src="resources/dump-list.js"></script>
     23<script>
     24    window.onload = function()
     25    {
     26        if (window.layoutTestController) {
     27            layoutTestController.dumpAsText();
     28            filterListsWithReplacement(document.querySelectorAll(".test ol"));
     29        }
     30    }
     31</script>
    2232  </head>
    2333  <body>
Note: See TracChangeset for help on using the changeset viewer.