Title: [99759] trunk/LayoutTests
Revision
99759
Author
[email protected]
Date
2011-11-09 14:16:50 -0800 (Wed, 09 Nov 2011)

Log Message

[Chromium] Layout Test fast/forms/select-clientheight-large-size.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=71880

Reviewed by Tony Chang.

Makes the test run ~10x faster by making the second select element only have 16
option elements. As best I can tell, that covers all the edge cases from r99653.

Also, cleaned up the test to make it a more normal js test:
-Gave it a doctype so it's in standards-mode.
-Moved the description to a description call.
-Generated both select element in script instead of just one of them.

* fast/forms/select-clientheight-large-size-expected.txt:
* fast/forms/select-clientheight-large-size.html:
* platform/chromium/test_expectations.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (99758 => 99759)


--- trunk/LayoutTests/ChangeLog	2011-11-09 22:09:39 UTC (rev 99758)
+++ trunk/LayoutTests/ChangeLog	2011-11-09 22:16:50 UTC (rev 99759)
@@ -1,3 +1,22 @@
+2011-11-09  Ojan Vafai  <[email protected]>
+
+        [Chromium] Layout Test fast/forms/select-clientheight-large-size.html is timing out
+        https://bugs.webkit.org/show_bug.cgi?id=71880
+
+        Reviewed by Tony Chang.
+
+        Makes the test run ~10x faster by making the second select element only have 16
+        option elements. As best I can tell, that covers all the edge cases from r99653.
+
+        Also, cleaned up the test to make it a more normal js test:
+        -Gave it a doctype so it's in standards-mode.
+        -Moved the description to a description call.
+        -Generated both select element in script instead of just one of them.
+
+        * fast/forms/select-clientheight-large-size-expected.txt:
+        * fast/forms/select-clientheight-large-size.html:
+        * platform/chromium/test_expectations.txt:
+
 2011-11-09  Antti Koivisto  <[email protected]>
 
         Update test description.

Modified: trunk/LayoutTests/fast/forms/select-clientheight-large-size-expected.txt (99758 => 99759)


--- trunk/LayoutTests/fast/forms/select-clientheight-large-size-expected.txt	2011-11-09 22:09:39 UTC (rev 99758)
+++ trunk/LayoutTests/fast/forms/select-clientheight-large-size-expected.txt	2011-11-09 22:16:50 UTC (rev 99759)
@@ -1,14 +1,15 @@
-HTMLSelectElement multiple attribute test when no size is specified
+Tests that select elements cap their size to the size attribute and to 4 when no size is specified.
 
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
 PASS clientHeight('select2') is clientHeight('select1')
 PASS getElemById('select2').setAttribute('size', '4'); clientHeight('select2') == clientHeight('select1') is true
 PASS getElemById('select2').setAttribute('size', '5'); clientHeight('select2') > clientHeight('select1') is true
 PASS getElemById('select2').setAttribute('size', '8'); clientHeight('select2') == multipleOfElement('select1', 2) is true
 PASS getElemById('select2').setAttribute('size', '12'); clientHeight('select2') == multipleOfElement('select1', 3) is true
 PASS getElemById('select2').setAttribute('size', '16'); clientHeight('select2') == multipleOfElement('select1', 4) is true
-PASS getElemById('select2').setAttribute('size', '400'); clientHeight('select2') == multipleOfElement('select1', 100) is true
-PASS getElemById('select2').setAttribute('size', '4000'); clientHeight('select2') == multipleOfElement('select1', 1000) is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-  
+

Modified: trunk/LayoutTests/fast/forms/select-clientheight-large-size.html (99758 => 99759)


--- trunk/LayoutTests/fast/forms/select-clientheight-large-size.html	2011-11-09 22:09:39 UTC (rev 99758)
+++ trunk/LayoutTests/fast/forms/select-clientheight-large-size.html	2011-11-09 22:16:50 UTC (rev 99759)
@@ -1,57 +1,32 @@
-<html>
-<head>
+<!DOCTYPE html>
 <script src=""
-</head>
-<body>
-<p>HTMLSelectElement multiple attribute test when no size is specified</p>
-<div id="console"></div>
-
-<select multiple id="select1" >
-    <option value="0">0</option>
-    <option value="1">1</option>
-    <option value="2">2</option>
-    <option value="3">3</option>
-    <option value="4">4</option>
-    <option value="5">5</option>
-    <option value="6">6</option>
-    <option value="7">7</option>
-    <option value="8">8</option>
-    <option value="9">9</option>
-</select>
-
-<select multiple id="select2" ></select>
-
+<div id="output"></div>
 <script>
+    description("Tests that select elements cap their size to the size attribute and to 4 when no size is specified.");
 
-    function AddItem(Text,Value) {
-        var opt = document.createElement("option");
-        document.getElementById("select2").options.add(opt);
-
-        opt.text = Text;
-        opt.value = Value;
-
-    }
-
     function getElemById(elemId) {
         return document.getElementById(elemId);
     }
 
     function clientHeight(elemId) {
-        var element = getElemById(elemId);
-        return element.clientHeight;
+        return getElemById(elemId).clientHeight;
     }
 
     function multipleOfElement(elemId, multiple) {
-        var element = getElemById(elemId);
-        var value = element.clientHeight * multiple + (multiple - 1);
-        return value;
+        return clientHeight(elemId) * multiple + (multiple - 1);
     }
 
-    var select = document.getElementById("select2");
+    function addSelect(id, numOptions)
+    {
+        var select = document.createElement("select2");
+        var html = '<select multiple id="' + id + '">';
+        for (var i = 0; i <= numOptions; i++)
+            html += '<option value="' + i + '">' + i + '</option>';
+        getElemById('output').innerHTML += html + '</select>';
+    }
     
-    // Add large number of options
-    for (i=0 ; i<= 10000 ;i++)
-        AddItem(i, i);
+    addSelect('select1', 10);
+    addSelect('select2', 16);
 
     shouldBe("clientHeight('select2')", "clientHeight('select1')");
     shouldBeTrue("getElemById('select2').setAttribute('size', '4'); clientHeight('select2') == clientHeight('select1')");
@@ -59,9 +34,5 @@
     shouldBeTrue("getElemById('select2').setAttribute('size', '8'); clientHeight('select2') == multipleOfElement('select1', 2)");
     shouldBeTrue("getElemById('select2').setAttribute('size', '12'); clientHeight('select2') == multipleOfElement('select1', 3)");
     shouldBeTrue("getElemById('select2').setAttribute('size', '16'); clientHeight('select2') == multipleOfElement('select1', 4)");
-    shouldBeTrue("getElemById('select2').setAttribute('size', '400'); clientHeight('select2') == multipleOfElement('select1', 100)");
-    shouldBeTrue("getElemById('select2').setAttribute('size', '4000'); clientHeight('select2') == multipleOfElement('select1', 1000)");
 </script>
 <script src=""
-</body>
-</html>

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (99758 => 99759)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-11-09 22:09:39 UTC (rev 99758)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-11-09 22:16:50 UTC (rev 99759)
@@ -3944,5 +3944,3 @@
 BUGRICOW : http/tests/security/xss-eval.html = TEXT
 
 BUGWK70395 MAC : fast/dom/rtl-scroll-to-leftmost-and-resize.html = IMAGE+TEXT
-
-BUGWK71880 DEBUG : fast/forms/select-clientheight-large-size.html = TIMEOUT
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to