Changeset 84961 in webkit


Ignore:
Timestamp:
Apr 26, 2011 2:49:10 PM (13 years ago)
Author:
Simon Fraser
Message:

2011-04-26 Simon Fraser <Simon Fraser>

Reviewed by Daniel Bates.

Convert some transition tests to use the pause API, and more cleanup
https://bugs.webkit.org/show_bug.cgi?id=59490

  • animations/animation-drt-api.html: Fail message was the same as the pass message (doh!).
  • platform/chromium-linux/transitions/transition-drt-api-expected.png: Removed.
  • platform/chromium-win/transitions/transition-drt-api-expected.png: Removed.
  • platform/chromium-win/transitions/transition-drt-api-expected.txt: Removed.
  • platform/gtk/transitions/transition-drt-api-expected.txt: Removed.
  • platform/mac/transitions/transition-drt-api-expected.png: Removed.
  • platform/mac/transitions/transition-drt-api-expected.txt: Removed.
  • transitions/transition-drt-api-expected.txt: Added.
  • transitions/transition-drt-api.html: Made into a text test.
  • transitions/font-family-during-transition.html: Use the pause API.
  • transitions/transition-drt-api-delay.html: General cleanup.
  • transitions/bad-transition-shorthand-crash.html: Shorten the test.
  • transitions/border-radius-transition.html:
  • transitions/default-timing-function.html:
  • transitions/interrupt-zero-duration.html: Remove style attribute
  • transitions/color-transition-premultiplied.html:
  • transitions/transition-timing-function-expected.txt:
  • transitions/transition-timing-function.html: Use pause API.
  • transitions/inherit-other-props.html:
  • transitions/transform-op-list-match.html: Whitespace.
  • transitions/opacity-transition-zindex.html: Add FIXME.
  • transitions/transition-shorthand-delay-expected.txt:
  • transitions/transition-shorthand-delay.html:
  • transitions/zero-duration-with-non-zero-delay-start-expected.txt:
  • transitions/zero-duration-with-non-zero-delay-start.html: Use runTransitionTest().
Location:
trunk/LayoutTests
Files:
1 added
6 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r84959 r84961  
     12011-04-26  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Daniel Bates.
     4
     5        Convert some transition tests to use the pause API, and more cleanup
     6        https://bugs.webkit.org/show_bug.cgi?id=59490
     7
     8        * animations/animation-drt-api.html:
     9        Fail message was the same as the pass message (doh!).
     10
     11        * platform/chromium-linux/transitions/transition-drt-api-expected.png: Removed.
     12        * platform/chromium-win/transitions/transition-drt-api-expected.png: Removed.
     13        * platform/chromium-win/transitions/transition-drt-api-expected.txt: Removed.
     14        * platform/gtk/transitions/transition-drt-api-expected.txt: Removed.
     15        * platform/mac/transitions/transition-drt-api-expected.png: Removed.
     16        * platform/mac/transitions/transition-drt-api-expected.txt: Removed.
     17        * transitions/transition-drt-api-expected.txt: Added.
     18        * transitions/transition-drt-api.html:
     19        Made into a text test.
     20        * transitions/font-family-during-transition.html:
     21        Use the pause API.
     22        * transitions/transition-drt-api-delay.html:
     23        General cleanup.
     24        * transitions/bad-transition-shorthand-crash.html:
     25        Shorten the test.
     26        * transitions/border-radius-transition.html:
     27        * transitions/default-timing-function.html:
     28        * transitions/interrupt-zero-duration.html:
     29        Remove style attribute
     30        * transitions/color-transition-premultiplied.html:
     31        * transitions/transition-timing-function-expected.txt:
     32        * transitions/transition-timing-function.html:
     33        Use pause API.
     34        * transitions/inherit-other-props.html:
     35        * transitions/transform-op-list-match.html:
     36        Whitespace.
     37        * transitions/opacity-transition-zindex.html:
     38        Add FIXME.
     39        * transitions/transition-shorthand-delay-expected.txt:
     40        * transitions/transition-shorthand-delay.html:
     41        * transitions/zero-duration-with-non-zero-delay-start-expected.txt:
     42        * transitions/zero-duration-with-non-zero-delay-start.html:
     43        Use runTransitionTest().
     44
    1452011-04-26  Maciej Stachowiak  <mjs@apple.com>
    246
  • trunk/LayoutTests/animations/animation-drt-api.html

    r84873 r84961  
    3939          result = "PASS: correctly paused animation";
    4040        else
    41           result = "PASS: correctly paused animation";
     41          result = "FAIL: failed to pause animation";
    4242
    4343        document.getElementById('results').innerText = result;
  • trunk/LayoutTests/transitions/bad-transition-shorthand-crash.html

    r84875 r84961  
    2121    function finish()
    2222    {
    23         layoutTestController.notifyDone();
     23        if (window.layoutTestController)
     24            layoutTestController.notifyDone();
    2425    }
    2526   
     
    2829        var box = document.getElementById('box');
    2930        box.style.webkitTransform = 'rotate(0)';
    30         setTimeout(finish, 100);
     31        setTimeout(finish, 20);
    3132    }
    3233   
     
    3536        var box = document.getElementById('box');
    3637        box.style.webkitTransform = 'rotate(180deg)';
    37         setTimeout(returnToStart, 100);
     38        setTimeout(returnToStart, 20);
    3839    }
    3940   
  • trunk/LayoutTests/transitions/border-radius-transition.html

    r84875 r84961  
    3131  </style>
    3232  <script src="resources/transition-test-helpers.js"></script>
    33   <script type="text/javascript">
     33  <script>
    3434
    3535    const expectedValues = [
  • trunk/LayoutTests/transitions/color-transition-premultiplied.html

    r84875 r84961  
    4444    }
    4545
    46     runTransitionTest(expectedValues, setupTest, true);
     46    runTransitionTest(expectedValues, setupTest, usePauseAPI);
    4747  </script>
    4848</head>
  • trunk/LayoutTests/transitions/default-timing-function.html

    r84875 r84961  
    4141  </style>
    4242  <script src="resources/transition-test-helpers.js"></script>
    43   <script type="text/javascript">
     43  <script>
    4444
    4545    const expectedValues = [
  • trunk/LayoutTests/transitions/font-family-during-transition.html

    r84874 r84961  
    4747    }
    4848
    49     runTransitionTest(expectedValues, setupTest, true);
     49    runTransitionTest(expectedValues, setupTest, usePauseAPI);
    5050  </script>
    5151</head>
  • trunk/LayoutTests/transitions/inherit-other-props.html

    r84875 r84961  
    6666    function testProperties()
    6767    {
    68 
    6968      var boxes = document.body.getElementsByClassName('box');
    7069      for (var i = 0; i < boxes.length; ++i) {
  • trunk/LayoutTests/transitions/interrupt-zero-duration.html

    r84875 r84961  
    1414    }
    1515    </style>
    16     <script type="text/javascript" charset="utf-8">
     16    <script>
    1717    if (window.layoutTestController) {
    1818        layoutTestController.dumpAsText();
  • trunk/LayoutTests/transitions/opacity-transition-zindex.html

    r84875 r84961  
    5555      }
    5656    }
    57    
     57    // FIXME: this should use runTransitionTest().
    5858    window.addEventListener('load', runTest, false);
    5959  </script>
  • trunk/LayoutTests/transitions/transform-op-list-match.html

    r84875 r84961  
    3535   
    3636    runTransitionTest(expectedValues, setupTest, usePauseAPI);
    37    
    3837  </script>
    3938</head>
  • trunk/LayoutTests/transitions/transition-drt-api-delay.html

    r84875 r84961  
    44<head>
    55  <style>
    6     div {
     6    #target {
    77      position: relative;
    88      left: 100px;
     
    1616    }
    1717   
    18     .moved {
     18    #target.moved {
    1919      left: 200px;
    2020    }
    2121   </style>
    2222   <script src="resources/transition-test-helpers.js"></script>
    23    <script type="text/javascript">
     23   <script>
    2424    function endTest() {
    2525      if (window.layoutTestController) {
     
    5454  </p>
    5555
    56   <div id="target">
    57   </div>
     56  <div id="target"></div>
    5857
    59   <div id="result">
    60   </div>
     58  <div id="result"></div>
    6159
    6260</body>
  • trunk/LayoutTests/transitions/transition-drt-api.html

    r84875 r84961  
    44<head>
    55  <style>
    6     body {
    7       margin: 0;
    8     }
    9    
    10     div {
     6    #target {
    117      position: relative;
    128      left: 100px;
    13       height: 200px;
    14       width: 200px;
    15       background-color: red;
     9      height: 100px;
     10      width: 100px;
     11      background-color: blue;
    1612      -webkit-transition-property: left;
    1713      -webkit-transition-duration: 4s;
     
    1915    }
    2016   
    21     .moved {
     17    #target.moved {
    2218      left: 200px;
    2319    }
    24      </style>
     20   </style>
    2521   <script>
     22    if (window.layoutTestController)
     23      layoutTestController.dumpAsText();
     24
    2625    function endTest() {
    2726      if (window.layoutTestController) {
    28         if (!layoutTestController.pauseTransitionAtTimeOnElementWithId("left", 1.0, "target"))
    29           throw("Transition is not running");
    30        
     27        var paused = layoutTestController.pauseTransitionAtTimeOnElementWithId("left", 1.0, "target");
     28        var result = "";
     29        if (paused)
     30          result = "PASS: correctly paused transition";
     31        else
     32          result = "FAIL: failed to pause transition";
     33
     34        document.getElementById('results').innerText = result;
    3135        layoutTestController.notifyDone();
    32       }
     36      } else
     37        document.getElementById('results').innerText = "This test requires DRT";
    3338    }
    3439   
     
    4348</head>
    4449<body onload="startTest()">
    45   <h1>Test for DRT pauseTransitionAtTimeOnElementWithId() API</h1>
    46 
    47   <div id="target">
    48   </div>
     50  <!-- Test for DRT pauseTransitionAtTimeOnElementWithId() API -->
     51  <div id="target"></div>
     52  <div id="results"></div>
    4953
    5054</body>
  • trunk/LayoutTests/transitions/transition-shorthand-delay-expected.txt

    r38957 r84961  
    1 Test for transition shorthand
     1PASS - "left" property for "target" element at 0.5s saw something close to: 125
    22
    3 This test works only in DumpRenderTree. It uses an API exposed only there to jump to a particular time in a running transition. Tests bug 21247
    4 
    5 PASS
  • trunk/LayoutTests/transitions/transition-shorthand-delay.html

    r84875 r84961  
    44<head>
    55  <style>
    6     body {
    7       margin: 0;
    8     }
    9    
    10     div {
     6    #target {
    117      position: relative;
    128      left: 100px;
     
    1410      width: 50px;
    1511      background-color: green;
    16       -webkit-transition: left 4s linear 1s;
     12      -webkit-transition: left 1s linear 250ms;
    1713    }
    1814   
    19     .moved {
     15    #target.moved {
    2016      left: 200px;
    2117    }
    2218   </style>
    2319   <script src="resources/transition-test-helpers.js"></script>
    24    <script type="text/javascript">
    25     function endTest() {
    26       if (window.layoutTestController) {
    27         layoutTestController.pauseTransitionAtTimeOnElementWithId("left", 2.0, "target");
    28         var left = window.getComputedStyle(document.getElementById('target')).left;
    29         var result = "PASS";
    30         if (left != "125px") {
    31           result = "FAIL - expected 125px got " + left;
    32         }
    33         document.getElementById('result').innerHTML = "<p>" + result + "</p>";
    34         layoutTestController.notifyDone();
    35       }
    36     }
    37    
    38     function startTest() {
    39       if (window.layoutTestController) {
    40         layoutTestController.dumpAsText();
    41         layoutTestController.waitUntilDone();
    42       }
    43      
    44       document.getElementById("target").className = "moved";
    45       waitForAnimationStart(endTest, 1);
    46     }
     20   <script>
     21     const expectedValues = [
     22       // [time, element-id, property, expected-value, tolerance]
     23       [0.5, "target", "left", 125, 4],
     24     ];
     25
     26     function setupTest()
     27     {
     28       document.getElementById("target").className = "moved";
     29     }
     30
     31     // Pause API isn't happy pausing during delay yet.
     32     // https://bugs.webkit.org/show_bug.cgi?id=59475
     33     runTransitionTest(expectedValues, setupTest, dontUsePauseAPI);
    4734   </script>
    4835</head>
    49 <body onload="startTest()">
    50   <h1>Test for transition shorthand</h1>
    51 
    52   <p>This test works only in DumpRenderTree. It uses an API exposed
    53     only there to jump to a particular time in a running transition.
    54     Tests bug <a href="https://bugs.webkit.org/show_bug.cgi?id=21247">21247</a>
    55   </p>
    56 
    57   <div id="target">
    58   </div>
    59 
    60   <div id="result">
    61   </div>
     36<body>
     37  <div id="target"></div>
     38  <div id="result"></div>
    6239
    6340</body>
  • trunk/LayoutTests/transitions/transition-timing-function-expected.txt

    r39384 r84961  
    1 box1: within 5% of 200: PASSED
    2 box2: within 5% of 320: PASSED
    3 box3: within 5% of 125: PASSED
    4 box4: within 5% of 272: PASSED
    5 box5: within 5% of 200: PASSED
     1PASS - "left" property for "box1" element at 0.5s saw something close to: 200
     2PASS - "left" property for "box2" element at 0.5s saw something close to: 322
     3PASS - "left" property for "box3" element at 0.5s saw something close to: 126
     4PASS - "left" property for "box4" element at 0.5s saw something close to: 273
     5PASS - "left" property for "box5" element at 0.5s saw something close to: 200
    66
  • trunk/LayoutTests/transitions/transition-timing-function.html

    r84875 r84961  
    99      margin: 10px;
    1010      background-color: blue;
    11       -webkit-transition-duration: 5s;
    12       -webkit-transition-timing-function: linear;
     11      -webkit-transition: left 1s linear;
     12    }
     13    .animating > .box {
     14      left: 400px;
    1315    }
    1416  </style>
     17  <script src="resources/transition-test-helpers.js"></script>
    1518  <script>
    16     if (window.layoutTestController) {
    17         layoutTestController.dumpAsText();
    18         layoutTestController.waitUntilDone();
    19     }
    20 
    21     var kExpecteds = {
    22       'box1' : 200,
    23       'box2' : 320,
    24       'box3' : 125,
    25       'box4' : 272,
    26       'box5' : 200
     19    const expectedValues = [
     20      // [time, element-id, property, expected-value, tolerance]
     21      [0.5, "box1", "left", 200, 4],
     22      [0.5, "box2", "left", 322, 4],
     23      [0.5, "box3", "left", 126, 4],
     24      [0.5, "box4", "left", 273, 4],
     25      [0.5, "box5", "left", 200, 4],
     26    ];
     27   
     28    function setupTest()
     29    {
     30      document.getElementById('container').className = 'animating';
    2731    }
    2832   
    29     function measurePosition()
    30     {
    31       var boxes = document.body.getElementsByClassName('box');
    32 
    33       var result = '';
    34       for (var i = 0; i < boxes.length; ++i)
    35       {
    36         var curBox = boxes[i];
    37         var curLeft = parseInt(window.getComputedStyle(curBox).left);
    38        
    39         var expected = kExpecteds[curBox.id];
    40         var passed = (Math.abs(curLeft - expected) / expected) < 0.05;
    41         var thisResult;
    42         if (passed)
    43           thisResult = curBox.id + ': within 5% of ' + expected + ': PASSED';
    44         else
    45           thisResult = curBox.id + ': expected ' + expected + ', got ' + curLeft + '; outside 5%: FAIL';
    46 
    47         result += thisResult + '<br>';
    48       }
    49 
    50       document.body.removeChild(document.getElementById('container'));
    51 
    52       document.getElementById('result').innerHTML = result;
    53 
    54       if (window.layoutTestController)
    55           layoutTestController.notifyDone();
    56     }
    57 
    58     function startTransition()
    59     {
    60       var boxes = document.body.getElementsByClassName('box');
    61       for (var i = 0; i < boxes.length; ++i)
    62         boxes[i].style.left = '400px';
    63      
    64       window.setTimeout(measurePosition, 2500);
    65     }
    66     window.addEventListener('load', startTransition, false);
     33    runTransitionTest(expectedValues, setupTest, usePauseAPI);
    6734  </script>
    6835</head>
  • trunk/LayoutTests/transitions/zero-duration-with-non-zero-delay-start-expected.txt

    r39711 r84961  
    1 Test that transitions with a zero-duration and but a non-zero delay effectively work
     1PASS - "left" property for "target" element at 1s saw something close to: 200
    22
    3 PASS - left property is 200px as expected
  • trunk/LayoutTests/transitions/zero-duration-with-non-zero-delay-start.html

    r84875 r84961  
    44<head>
    55  <style>
    6     body {
    7       margin: 0;
    8     }
    9    
    106    #target {
    117      position: relative;
    128      top: 100px;
    139      left: 100px;
    14       width: 200px;
    15       height: 200px;
    16       background-color: red;
     10      width: 100px;
     11      height: 100px;
     12      background-color: blue;
    1713      -webkit-transition-property: left;
    1814      -webkit-transition-duration: 0s;
     
    2016    }
    2117   
     18    #target.moved {
     19      left: 200px;
     20    }
    2221   </style>
     22   <script src="resources/transition-test-helpers.js"></script>
    2323   <script>
    24    
    25     function finishTest() {
    26       var expected = 200;
    27       var current = parseInt(window.getComputedStyle(document.getElementById('target')).left);
    28       if (current == expected)
    29         document.getElementById('result').innerHTML = "PASS - left property is " + current + "px as expected";
    30       else
    31         document.getElementById('result').innerHTML = "FAIL - left property is " + current + "px instead of " + expected + "px";
     24    const expectedValues = [
     25      // [time, element-id, property, expected-value, tolerance]
     26      [1, "target", "left", 200, 4],
     27    ];
    3228
    33       if (window.layoutTestController)
    34         layoutTestController.notifyDone();
     29    function setupTest()
     30    {
     31      document.getElementById('target').className = 'moved';
    3532    }
    36    
    37     function runTest() {
    38       window.setTimeout(finishTest, 1000);
    39     }
    40    
    41     function startTest() {
    42       if (window.layoutTestController) {
    43         layoutTestController.dumpAsText();
    44         layoutTestController.waitUntilDone();
    45       }
    46      
    47       var target = document.getElementById('target');
    48       target.style.left = '200px';
    49        
    50       window.setTimeout(runTest, 0);
    51     }
     33
     34    // Pause API isn't happy pausing during delay yet.
     35    // https://bugs.webkit.org/show_bug.cgi?id=59475
     36    runTransitionTest(expectedValues, setupTest, dontUsePauseAPI);
    5237   </script>
    5338</head>
    54 <body onload="startTest()">
    55   <h1>Test that transitions with a zero-duration and but a non-zero delay effectively work</h1>
     39<body>
    5640
    57   <div id="target">
    58   </div>
    59 
    60   <div id="result">
    61   </div>
     41  <div id="target"></div>
     42  <div id="result"></div>
    6243
    6344</body>
Note: See TracChangeset for help on using the changeset viewer.