Bug 1406285 - Part 2: Add test for animation target node. r=gl

MozReview-Commit-ID: toLYDFugJs

--HG--
extra : rebase_source : 2cc22a8e5e9251fd53d5afa91b6d96e46cd7dc73
This commit is contained in:
Daisuke Akatsuka 2018-01-18 10:40:51 +09:00
parent 9b35f54945
commit 105b6a7410
3 changed files with 33 additions and 1 deletions

View File

@ -12,5 +12,6 @@ support-files =
[browser_animation_animation_list_exists.js]
[browser_animation_animation_list_time_tick.js]
[browser_animation_AnimationTarget.js]
[browser_animation_empty_on_invalid_nodes.js]
[browser_animation_inspector_exists.js]

View File

@ -0,0 +1,32 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test existance and content of animation target.
add_task(async function () {
await addTab(URL_ROOT + "doc_simple_animation.html");
const { animationInspector, inspector, panel } = await openAnimationInspector();
info("Checking the animation target elements existance");
const animationItemEls = panel.querySelectorAll(".animation-list .animation-item");
is(animationItemEls.length, animationInspector.animations.length,
"Number of animation target element should be same to number of animations "
+ "that displays");
for (const animationItemEl of animationItemEls) {
const animationTargetEl = animationItemEl.querySelector(".animation-target");
ok(animationTargetEl,
"The animation target element should be in each animation item element");
}
info("Checking the content of animation target");
await selectNodeAndWaitForAnimations(".animated", inspector);
const animationTargetEl =
panel.querySelector(".animation-list .animation-item .animation-target");
is(animationTargetEl.textContent, "div.ball.animated",
"The target element's content is correct");
ok(animationTargetEl.querySelector(".objectBox"),
"objectBox is in the page exists");
});

View File

@ -35,6 +35,5 @@ add_task(async function () {
// TODO: We need to add following tests after implement since this test has same role
// of animationinspector/test/browser_animation_timeline_ui.js
// * name label in animation element existance.
// * target node in animation element existance.
// * summary graph in animation element existance.
});