mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 18:55:30 +00:00
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 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
26bd1e060c
commit
a37ef3224e
@ -164,19 +164,30 @@ promise_test(async () => {
|
||||
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");
|
||||
|
Loading…
Reference in New Issue
Block a user