Changeset 109595 in webkit


Ignore:
Timestamp:
Mar 2, 2012 12:01:10 PM (12 years ago)
Author:
jchaffraix@webkit.org
Message:

[chromium] Layout test fast/events/overflow-events.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=52064

Reviewed by Simon Fraser.

Try to make the test less flaky.

  • fast/events/overflow-events.html:

Ensure that the 'overflow' events arrive one at a time in order (there is no guarantee that they *do* dispatch
though). Also added a clearer message if we fail the test. That should help us if the test is still flaky.

Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r109594 r109595  
     12012-03-02  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        [chromium] Layout test fast/events/overflow-events.html is flaky
     4        https://bugs.webkit.org/show_bug.cgi?id=52064
     5
     6        Reviewed by Simon Fraser.
     7
     8        Try to make the test less flaky.
     9
     10        * fast/events/overflow-events.html:
     11        Ensure that the 'overflow' events arrive one at a time in order (there is no guarantee that they *do* dispatch
     12        though). Also added a clearer message if we fail the test. That should help us if the test is still flaky.
     13
    1142012-03-02  Maciej Stachowiak  <mjs@apple.com>
    215
  • trunk/LayoutTests/fast/events/overflow-events.html

    r65226 r109595  
    22<head>
    33  <script>
     4    function setupTest() {
     5        var horizontalOverflow = testResults[currentTest][1];
     6        if (horizontalOverflow) {
     7            document.getElementById('child').style.width = '200px';
     8        } else {
     9            document.getElementById('child').style.width = '50px';
     10        }
     11
     12        var verticalOverflow = testResults[currentTest][2];
     13        if (verticalOverflow) {
     14            document.getElementById('child').style.height = '200px';
     15        } else {
     16            document.getElementById('child').style.height = '50px';
     17        }
     18    }
     19
     20    function finished(result)
     21    {
     22        document.getElementById('result').innerHTML = result;
     23
     24        if (window.layoutTestController)
     25            layoutTestController.notifyDone();
     26    }
     27
     28    function nextTest() {
     29        if (currentTest == testResults.length) {
     30            finished("SUCCESS");
     31            return;
     32        }
     33
     34        forceLayout();
     35        setupTest();
     36        forceLayout();
     37    }
     38
    439    function overflowChanged(event) {
    540        var result = [event.orient, event.horizontalOverflow, event.verticalOverflow];
    641
    7         if ('' + result == testResults[currentTest++])
    8             numSuccessful ++;
    9         if (testResults.length == numSuccessful)
    10             document.getElementById('result').innerHTML = "SUCCESS";
     42        if ('' + result == testResults[currentTest]) {
     43            currentTest++;
     44            nextTest();
     45        } else
     46            finished("FAILURE: expected " + testResults[currentTest] + " got " + result);
    1147    }
    1248
     
    1652
    1753    function runTest() {
    18         if (window.layoutTestController)
     54        if (window.layoutTestController) {
    1955            layoutTestController.dumpAsText();
     56            layoutTestController.waitUntilDone();
     57        }
    2058
    2159        testResults = [[OverflowEvent.HORIZONTAL, true, false],
     
    3068
    3169        currentTest = 0;
    32         numSuccessful = 0;
    3370
    3471        var c = document.getElementById('container');
    3572        c.addEventListener('overflowchanged', overflowChanged, false);
    36 
    37         forceLayout();
    38         document.getElementById('child').style.width='200px';
    39 
    40         forceLayout();
    41         document.getElementById('child').style.width='50px';
    42         forceLayout();
    43 
    44         document.getElementById('child').style.height='200px';
    45         forceLayout();
    46         document.getElementById('child').style.height='50px';
    47         forceLayout();
    48 
    49         forceLayout();
    50         document.getElementById('child').style.width='200px';
    51         document.getElementById('child').style.height='200px';
    52         forceLayout();
    53 
    54         document.getElementById('child').style.width='50px';
    55         document.getElementById('child').style.height='50px';
    56         forceLayout();
    57 
    58         document.getElementById('child').style.height='200px';
    59         forceLayout();
    60 
    61         document.getElementById('child').style.width='200px';
    62         document.getElementById('child').style.height='50px';
    63         forceLayout();
    64 
    65         document.getElementById('child').style.width='50px';
    66         document.getElementById('child').style.height='200px';
    67         forceLayout();
    68 
     73        nextTest();
    6974    }
    7075  </script>
Note: See TracChangeset for help on using the changeset viewer.