Bug 1368371: Address background color of animations for any theme. r=pbro
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 30 May 2017 16:04:33 +0900
changeset 409411 45ed06524ff0d53dbaf58d5a5f279379d7019bb3
parent 409410 29177506860daae357a7ce2627937ade8b46760c
child 409412 c9d839d793c61078b9c953ad6bee96df8269bde8
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1368371
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368371: Address background color of animations for any theme. r=pbro MozReview-Commit-ID: FKrprWzclzr
devtools/client/animationinspector/test/browser_animation_timeline_ui.js
--- a/devtools/client/animationinspector/test/browser_animation_timeline_ui.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_ui.js
@@ -21,32 +21,38 @@ add_task(function* () {
      "The header has some time graduations");
 
   ok(el.querySelector(".animations"),
      "The animations container is in the DOM of the timeline");
   is(el.querySelectorAll(".animations .animation").length,
      timeline.animations.length,
      "The number of animations displayed matches the number of animations");
 
+  const animationEls = el.querySelectorAll(".animations .animation");
+  const evenColor =
+    el.ownerDocument.defaultView.getComputedStyle(animationEls[0]).backgroundColor;
+  const oddColor =
+    el.ownerDocument.defaultView.getComputedStyle(animationEls[1]).backgroundColor;
+  isnot(evenColor, oddColor,
+        "Background color of an even animation should be different from odd");
   for (let i = 0; i < timeline.animations.length; i++) {
     let animation = timeline.animations[i];
-    let animationEl = el.querySelectorAll(".animations .animation")[i];
+    let animationEl = animationEls[i];
 
     ok(animationEl.querySelector(".target"),
        "The animated node target element is in the DOM");
     ok(animationEl.querySelector(".time-block"),
        "The timeline element is in the DOM");
     is(animationEl.querySelector(".name").textContent,
        animation.state.name,
        "The name on the timeline is correct");
     is(animationEl.querySelectorAll("svg g").length, 1,
        "The g element should be one since this doc's all animation has only one shape");
     ok(animationEl.querySelector("svg g path"),
        "The timeline has svg and path element as summary graph");
 
-    const expectedBackgroundColor =
-      i % 2 === 0 ? "rgba(128, 128, 128, 0.03)" : "rgba(0, 0, 0, 0)";
+    const expectedBackgroundColor = i % 2 === 0 ? evenColor : oddColor;
     const backgroundColor =
-      animationEl.ownerDocument.defaultView.getComputedStyle(animationEl).backgroundColor;
+      el.ownerDocument.defaultView.getComputedStyle(animationEl).backgroundColor;
     is(backgroundColor, expectedBackgroundColor,
        "The background-color shoud be changed to alternate");
   }
 });