Changeset 260513 in webkit
- Timestamp:
- Apr 22, 2020 9:21:37 AM (4 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r260509 r260513 1 2020-04-22 Antoine Quint <graouts@apple.com> 2 3 [ Mojave wk1 Release ] animations/transition-and-animation-1.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=210051 5 <rdar://problem/61345177> 6 7 Reviewed by Simon Fraser. 8 9 The purpose of this test is to check that running an animation does not trigger a transition for the animated 10 property. The way this test was written is that it would use `setTimeout()` to set a timer at a time computed to 11 be 500ms after the completion of the animation. However, using a timer like this is flaky by design as the animation 12 could technically be still in flight if the system is under heavy load. 13 14 We rewrite this test to use an "animationend" event to determine the animation has really completed and then wait 15 another frame, using `requestAnimationFrame()` to check that the computed style is as expected. 16 17 * animations/transition-and-animation-1.html: 18 * resources/ui-helper.js: 19 (window.UIHelper.waitForEvent): 20 1 21 2020-04-22 Jason Lawrence <lawrence.j@apple.com> 2 22 -
trunk/LayoutTests/animations/transition-and-animation-1.html
r236541 r260513 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">1 <!DOCTYPE html> 2 2 3 3 <html lang="en"> … … 13 13 width: 100px; 14 14 background-color: blue; 15 -webkit-animation-duration: 0.5s;16 -webkit-animation-timing-function: linear;17 -webkit-animation-name: "anim";18 -webkit-transition-property: -webkit-transform;19 -webkit-transition-duration: 10s;15 animation-duration: 0.5s; 16 animation-timing-function: linear; 17 animation-name: "anim"; 18 transition-property: transform; 19 transition-duration: 10s; 20 20 } 21 21 @-webkit-keyframes "anim" { 22 from { -webkit-transform: translateX(200px); }23 to { -webkit-transform: translateX(300px); }22 from { transform: translateX(200px); } 23 to { transform: translateX(300px); } 24 24 } 25 25 </style> 26 <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script> 27 <script type="text/javascript" charset="utf-8"> 28 26 <script src="../resources/ui-helper.js"></script> 27 <script src="resources/animation-test-helpers.js"></script> 28 <script type="text/javascript"> 29 30 if (window.testRunner) 31 testRunner.dumpAsText(); 32 29 33 const expectedValues = [ 30 34 // [animation-name, time, element-id, property, expected-value, tolerance] 31 [null, 0.55, "box", " webkitTransform", "none", null],35 [null, 0.55, "box", "transform", "none", null], 32 36 ]; 33 34 runAnimationTest(expectedValues); 35 36 </script> 37 38 window.addEventListener("DOMContentLoaded", async event => { 39 await UIHelper.waitForEvent(document.getElementById("box"), "animationend"); 40 await UIHelper.animationFrame(); 41 checkExpectedValue(expectedValues, 0); 42 endTest(); 43 }); 44 45 </script> 37 46 </head> 38 47 <body> -
trunk/LayoutTests/resources/ui-helper.js
r260402 r260513 1041 1041 if (menuRect) 1042 1042 await this.activateAt(menuRect.left + menuRect.width / 2, menuRect.top + menuRect.height / 2); 1043 } 1044 1045 static waitForEvent(target, eventName) 1046 { 1047 return new Promise(resolve => target.addEventListener(eventName, resolve, { once: true })); 1043 1048 } 1044 1049
Note: See TracChangeset
for help on using the changeset viewer.