mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1197100 - 1 - Add getFrames method to the AnimationPlayerActor; r=miker
This commit is contained in:
parent
74f841a8a1
commit
0504434ab1
@ -89,7 +89,9 @@ var getServerTraits = Task.async(function*(target) {
|
||||
{ name: "hasTargetNode", actor: "domwalker",
|
||||
method: "getNodeFromActor" },
|
||||
{ name: "hasSetCurrentTimes", actor: "animations",
|
||||
method: "setCurrentTimes" }
|
||||
method: "setCurrentTimes" },
|
||||
{ name: "hasGetFrames", actor: "animationplayer",
|
||||
method: "getFrames" }
|
||||
];
|
||||
|
||||
let traits = {};
|
||||
|
@ -414,6 +414,20 @@ var AnimationPlayerActor = ActorClass({
|
||||
currentTime: Arg(0, "number")
|
||||
},
|
||||
response: {}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Get data about the keyframes of this animation player.
|
||||
* @return {Object} Returns a list of frames, each frame containing the list
|
||||
* animated properties as well as the frame's offset.
|
||||
*/
|
||||
getFrames: method(function() {
|
||||
return this.player.effect.getFrames();
|
||||
}, {
|
||||
request: {},
|
||||
response: {
|
||||
frames: RetVal("json")
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
@ -37,6 +37,7 @@ skip-if = e10s # Bug 1183605 - devtools/server/tests/browser/ tests are still di
|
||||
[browser_animation_actors_14.js]
|
||||
[browser_animation_actors_15.js]
|
||||
[browser_animation_actors_16.js]
|
||||
[browser_animation_actors_17.js]
|
||||
[browser_canvasframe_helper_01.js]
|
||||
skip-if = e10s # Bug 1183605 - devtools/server/tests/browser/ tests are still disabled in E10S
|
||||
[browser_canvasframe_helper_02.js]
|
||||
|
41
devtools/server/tests/browser/browser_animation_actors_17.js
Normal file
41
devtools/server/tests/browser/browser_animation_actors_17.js
Normal file
@ -0,0 +1,41 @@
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Check that the AnimationPlayerActor exposes a getFrames method that returns
|
||||
// the list of keyframes in the animation.
|
||||
|
||||
const {AnimationsFront} = require("devtools/server/actors/animation");
|
||||
const {InspectorFront} = require("devtools/server/actors/inspector");
|
||||
|
||||
const URL = MAIN_DOMAIN + "animation.html";
|
||||
|
||||
add_task(function*() {
|
||||
yield addTab(MAIN_DOMAIN + "animation.html");
|
||||
|
||||
initDebuggerServer();
|
||||
let client = new DebuggerClient(DebuggerServer.connectPipe());
|
||||
let form = yield connectDebuggerClient(client);
|
||||
let inspector = InspectorFront(client, form);
|
||||
let walker = yield inspector.getWalker();
|
||||
let front = AnimationsFront(client, form);
|
||||
|
||||
info("Get the test node and its animation front");
|
||||
let node = yield walker.querySelector(walker.rootNode, ".simple-animation");
|
||||
let [player] = yield front.getAnimationPlayersForNode(node);
|
||||
|
||||
ok(player.getFrames, "The front has the getFrames method");
|
||||
|
||||
let frames = yield player.getFrames();
|
||||
is(frames.length, 2, "The correct number of keyframes was retrieved");
|
||||
ok(frames[0].transform, "Frame 0 has the transform property");
|
||||
ok(frames[1].transform, "Frame 1 has the transform property");
|
||||
// Note that we don't really test the content of the frame object here on
|
||||
// purpose. This object comes straight out of the web animations API
|
||||
// unmodified.
|
||||
|
||||
yield closeDebuggerClient(client);
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
Loading…
Reference in New Issue
Block a user