Bug 1467399 - Part 3: Modify a test for compositor sign. r?pbro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 20 Jun 2018 20:11:42 +0900
changeset 808670 fda717eec0291e81b52bcbc7b982523146ed3e1c
parent 808669 308538e0e17082fc97c10a1d090a15bb79d27ff4
child 808850 2b72e1a0ad117b367c5294d693434efa4f782140
push id113460
push userbmo:dakatsuka@mozilla.com
push dateWed, 20 Jun 2018 11:31:27 +0000
reviewerspbro
bugs1467399
milestone62.0a1
Bug 1467399 - Part 3: Modify a test for compositor sign. r?pbro MozReview-Commit-ID: I7yLF334RJO
devtools/client/inspector/animation/test/browser_animation_summary-graph_compositor.js
--- a/devtools/client/inspector/animation/test/browser_animation_summary-graph_compositor.js
+++ b/devtools/client/inspector/animation/test/browser_animation_summary-graph_compositor.js
@@ -5,17 +5,17 @@
 
 // Test that when animations displayed in the timeline are running on the
 // compositor, they get a special icon and information in the tooltip.
 
 add_task(async function() {
   await addTab(URL_ROOT + "doc_simple_animation.html");
   await removeAnimatedElementsExcept(
     [".compositor-all", ".compositor-notall", ".no-compositor"]);
-  const { inspector, panel } = await openAnimationInspector();
+  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"),
     "The element has the compositor css class");
   ok(hasTooltip(summaryGraphEl,
@@ -37,14 +37,41 @@ add_task(async function() {
   info("Select a node we know has animation on the compositor and not on the compositor");
   await selectNodeAndWaitForAnimations(".compositor-notall", inspector);
 
   ok(summaryGraphEl.classList.contains("compositor"),
     "The element has the compositor css class");
   ok(hasTooltip(summaryGraphEl,
                 ANIMATION_L10N.getStr("player.somePropertiesOnCompositorTooltip")),
      "The element has the right tooltip content");
+
+  info("Check compositor sign after pausing");
+  await clickOnPauseResumeButton(animationInspector, panel);
+  ok(!summaryGraphEl.classList.contains("compositor"),
+    "The element should not have the compositor css class after pausing");
+
+  info("Check compositor sign after resuming");
+  await clickOnPauseResumeButton(animationInspector, panel);
+  ok(summaryGraphEl.classList.contains("compositor"),
+    "The element should have the compositor css class after resuming");
+
+  info("Check compositor sign after rewind");
+  await clickOnRewindButton(animationInspector, panel);
+  ok(!summaryGraphEl.classList.contains("compositor"),
+    "The element should not have the compositor css class after rewinding");
+  await clickOnPauseResumeButton(animationInspector, panel);
+  ok(summaryGraphEl.classList.contains("compositor"),
+    "The element should have the compositor css class after resuming");
+
+  info("Check compositor sign after setting the current time");
+  await clickOnCurrentTimeScrubberController(animationInspector, panel, 0.5);
+  ok(!summaryGraphEl.classList.contains("compositor"),
+    "The element should not have the compositor css class " +
+    "after setting the current time");
+  await clickOnPauseResumeButton(animationInspector, panel);
+  ok(summaryGraphEl.classList.contains("compositor"),
+    "The element should have the compositor css class after resuming");
 });
 
 function hasTooltip(summaryGraphEl, expected) {
   const tooltip = summaryGraphEl.getAttribute("title");
   return tooltip.includes(expected);
 }