Bug 1532205 - Intermittent TEST-UNEXPECTED-TIMEOUT in Event-dispatch-on-disabled-elements.html r=birtles
authorMarcos Cáceres <mcaceres@mozilla.com>
Fri, 15 Mar 2019 05:49:25 +0000
changeset 522018 a7d81b7bc493094223744d4010c87789cdf2977e
parent 522016 4d62ab0e31fd6918ca95763914a8bdf41afe757a
child 522019 dd95011124a522d76265e0cd3382bf7ada44b750
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1532205
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1532205 - Intermittent TEST-UNEXPECTED-TIMEOUT in Event-dispatch-on-disabled-elements.html r=birtles try to extend the animation time. I tested this locally on repeat 50 times. Differential Revision: https://phabricator.services.mozilla.com/D23498
testing/web-platform/tests/dom/events/Event-dispatch-on-disabled-elements.html
--- a/testing/web-platform/tests/dom/events/Event-dispatch-on-disabled-elements.html
+++ b/testing/web-platform/tests/dom/events/Event-dispatch-on-disabled-elements.html
@@ -159,29 +159,40 @@ promise_test(async () => {
 }, "CSS Transitions transitioncancel event fires on disabled form elements");
 
 promise_test(async () => {
   // For each form element type, set up transition event handlers.
   for (const localName of formElements) {
     const elem = document.createElement(localName);
     document.body.appendChild(elem);
     elem.disabled = true;
-    const eventPromises = [
-      "animationstart",
-      "animationiteration",
-      "animationend",
-    ].map(eventType => {
-      return new Promise(r => {
-        elem.addEventListener(eventType, r, { once: true });
+    const animationStartPromise = new Promise(r => {
+      elem.addEventListener("animationstart", () => {
+        // Seek to the second iteration to trigger the animationiteration event
+        elem.style.animationDelay = "-100s"
+        r();
       });
     });
-    elem.style.animation = "fade .1s 2";
+    const animationIterationPromise = new Promise(r => {
+      elem.addEventListener("animationiteration", ()=>{
+        elem.style.animationDelay = "-200s"
+        r();
+      });
+    });
+    const animationEndPromise = new Promise(r => {
+      elem.addEventListener("animationend", r);
+    });
+    elem.style.animation = "fade 100s 2";
     elem.classList.add("animate");
     // All the events fire...
-    await Promise.all(eventPromises);
+    await Promise.all([
+      animationStartPromise,
+      animationIterationPromise,
+      animationEndPromise,
+    ]);
     elem.remove();
   }
 }, "CSS Animation animationstart, animationiteration, animationend fire on disabled form elements");
 
 promise_test(async () => {
   // For each form element type, set up transition event handlers.
   for (const localName of formElements) {
     const elem = document.createElement(localName);