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:
Marcos Cáceres 2019-03-15 05:49:25 +00:00
Родитель 26bd1e060c
Коммит a37ef3224e
1 изменённых файлов: 20 добавлений и 9 удалений

Просмотреть файл

@ -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");