Bug 1500833: Add a test which adds animation then immediately removes that. r=pbro

Depends on D9616

Differential Revision: https://phabricator.services.mozilla.com/D9617

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daisuke Akatsuka 2018-10-25 00:41:00 +00:00
parent a2f3ad1333
commit eb01f5fd2e
3 changed files with 49 additions and 0 deletions

View File

@ -9,6 +9,7 @@ support-files =
doc_multi_easings.html
doc_multi_keyframes.html
doc_multi_timings.html
doc_mutations_add_remove_immediately.html
doc_mutations_fast.html
doc_negative_playback_rate.html
doc_overflowed_delay_end_delay.html
@ -68,6 +69,7 @@ skip-if = (os == "win" && ccov) # Bug 1490981
[browser_animation_logic_avoid-updating-during-hiding.js]
[browser_animation_logic_created-time.js]
[browser_animation_logic_mutations.js]
[browser_animation_logic_mutations_add_remove_immediately.js]
[browser_animation_logic_mutations_fast.js]
skip-if= true # Bug 1500046
[browser_animation_logic_mutations_properties.js]

View File

@ -0,0 +1,25 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test whether the animation inspector will not crash when add animation then remove
// immediately.
add_task(async function() {
const tab = await addTab(URL_ROOT + "doc_mutations_add_remove_immediately.html");
const { inspector, panel } = await openAnimationInspector();
info("Check state of the animation inspector after fast mutations");
const onDispatch = waitForDispatch(inspector, "UPDATE_ANIMATIONS", () => 1);
await startMutation(tab);
await onDispatch;
ok(panel.querySelector(".animation-error-message"),
"No animations message should display");
});
async function startMutation(tab) {
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
await content.wrappedJSObject.startMutation();
});
}

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div></div>
<script>
"use strict";
// This function is called from test.
// eslint-disable-next-line
function startMutation() {
const target = document.querySelector("div");
const animation = target.animate({ opacity: [1, 0] }, 100000);
animation.currentTime = 1;
animation.cancel();
}
</script>
</body>
</html>