summaryrefslogtreecommitdiffstats
path: root/devtools/client/animationinspector/test/browser_animation_playerWidgets_appear_on_panel_init.js
blob: 271b26df37bf7fd2bbf1a5129d7601e48933c5c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
 http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Test that player widgets are displayed right when the animation panel is
// initialized, if the selected node (<body> by default) is animated.

const { ANIMATION_TYPES } = require("devtools/server/actors/animation");

add_task(function* () {
  yield addTab(URL_ROOT + "doc_multiple_animation_types.html");

  let {panel} = yield openAnimationInspector();
  is(panel.animationsTimelineComponent.animations.length, 3,
    "Three animations are handled by the timeline after init");
  assertAnimationsDisplayed(panel, 3,
    "Three animations are displayed after init");
  is(
    panel.animationsTimelineComponent
         .animationsEl
         .querySelectorAll(`.animation.${ANIMATION_TYPES.SCRIPT_ANIMATION}`)
         .length,
    1,
    "One script-generated animation is displayed");
  is(
    panel.animationsTimelineComponent
         .animationsEl
         .querySelectorAll(`.animation.${ANIMATION_TYPES.CSS_ANIMATION}`)
         .length,
    1,
    "One CSS animation is displayed");
  is(
    panel.animationsTimelineComponent
         .animationsEl
         .querySelectorAll(`.animation.${ANIMATION_TYPES.CSS_TRANSITION}`)
         .length,
    1,
    "One CSS transition is displayed");
});