From eb01f5fd2ebc9b28cd9d26804776728a9ec5086f Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Thu, 25 Oct 2018 00:41:00 +0000 Subject: [PATCH] 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 --- .../inspector/animation/test/browser.ini | 2 ++ ..._logic_mutations_add_remove_immediately.js | 25 +++++++++++++++++++ .../doc_mutations_add_remove_immediately.html | 22 ++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 devtools/client/inspector/animation/test/browser_animation_logic_mutations_add_remove_immediately.js create mode 100644 devtools/client/inspector/animation/test/doc_mutations_add_remove_immediately.html diff --git a/devtools/client/inspector/animation/test/browser.ini b/devtools/client/inspector/animation/test/browser.ini index 7a6eda57b02d..5e4b42455772 100644 --- a/devtools/client/inspector/animation/test/browser.ini +++ b/devtools/client/inspector/animation/test/browser.ini @@ -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] diff --git a/devtools/client/inspector/animation/test/browser_animation_logic_mutations_add_remove_immediately.js b/devtools/client/inspector/animation/test/browser_animation_logic_mutations_add_remove_immediately.js new file mode 100644 index 000000000000..2ce0b55ce780 --- /dev/null +++ b/devtools/client/inspector/animation/test/browser_animation_logic_mutations_add_remove_immediately.js @@ -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(); + }); +} diff --git a/devtools/client/inspector/animation/test/doc_mutations_add_remove_immediately.html b/devtools/client/inspector/animation/test/doc_mutations_add_remove_immediately.html new file mode 100644 index 000000000000..c8b3db749b9b --- /dev/null +++ b/devtools/client/inspector/animation/test/doc_mutations_add_remove_immediately.html @@ -0,0 +1,22 @@ + + + + + + +
+ + + +