From 8cae79d7414818941b0b578981a117cf79a706ec Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Wed, 25 Jul 2018 12:28:03 +0900 Subject: [PATCH] Bug 1473586: Reduce testing time and add requestLongerTimeout. r=gl MozReview-Commit-ID: 75EaEwkISrY --HG-- extra : source : a3f6db75bb07da37512f032485af29f99649dd67 --- ...wser_animation_summary-graph_compositor.js | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/devtools/client/inspector/animation/test/browser_animation_summary-graph_compositor.js b/devtools/client/inspector/animation/test/browser_animation_summary-graph_compositor.js index 818f3e683662..231e4958ebb0 100644 --- a/devtools/client/inspector/animation/test/browser_animation_summary-graph_compositor.js +++ b/devtools/client/inspector/animation/test/browser_animation_summary-graph_compositor.js @@ -6,37 +6,36 @@ // Test that when animations displayed in the timeline are running on the // compositor, they get a special icon and information in the tooltip. +requestLongerTimeout(2); + add_task(async function() { await addTab(URL_ROOT + "doc_simple_animation.html"); await removeAnimatedElementsExcept( [".compositor-all", ".compositor-notall", ".no-compositor"]); const { animationInspector, inspector, panel } = await openAnimationInspector(); - info("Select a test node we know has an animation running on the compositor"); - await selectNodeAndWaitForAnimations(".compositor-all", inspector); - - const summaryGraphEl = panel.querySelector(".animation-summary-graph"); - ok(summaryGraphEl.classList.contains("compositor"), + info("Check animation whose all properties are running on compositor"); + const summaryGraphAllEl = findSummaryGraph(".compositor-all", panel); + ok(summaryGraphAllEl.classList.contains("compositor"), "The element has the compositor css class"); - ok(hasTooltip(summaryGraphEl, + ok(hasTooltip(summaryGraphAllEl, ANIMATION_L10N.getStr("player.allPropertiesOnCompositorTooltip")), "The element has the right tooltip content"); - info("Select a node we know doesn't have an animation on the compositor"); - await selectNodeAndWaitForAnimations(".no-compositor", inspector); - - ok(!summaryGraphEl.classList.contains("compositor"), + info("Check animation is not running on compositor"); + const summaryGraphNoEl = findSummaryGraph(".no-compositor", panel); + ok(!summaryGraphNoEl.classList.contains("compositor"), "The element does not have the compositor css class"); - ok(!hasTooltip(summaryGraphEl, + ok(!hasTooltip(summaryGraphNoEl, ANIMATION_L10N.getStr("player.allPropertiesOnCompositorTooltip")), "The element does not have oncompositor tooltip content"); - ok(!hasTooltip(summaryGraphEl, + ok(!hasTooltip(summaryGraphNoEl, ANIMATION_L10N.getStr("player.somePropertiesOnCompositorTooltip")), "The element does not have oncompositor tooltip content"); - info("Select a node we know has animation on the compositor and not on the compositor"); + info("Select a node has animation whose some properties are running on compositor"); await selectNodeAndWaitForAnimations(".compositor-notall", inspector); - + const summaryGraphEl = panel.querySelector(".animation-summary-graph"); ok(summaryGraphEl.classList.contains("compositor"), "The element has the compositor css class"); ok(hasTooltip(summaryGraphEl, @@ -71,6 +70,11 @@ add_task(async function() { "The element should have the compositor css class after resuming"); }); +function findSummaryGraph(selector, panel) { + const animationItemEl = findAnimationItemElementsByTargetSelector(panel, selector); + return animationItemEl.querySelector(".animation-summary-graph"); +} + function hasTooltip(summaryGraphEl, expected) { const tooltip = summaryGraphEl.getAttribute("title"); return tooltip.includes(expected);