/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* vim: set ts=2 sw=2 sts=2 et: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* testcase data for <animateMotion> */
// Fake motion 'attribute', to satisfy testing code that expects an attribute. var gMotionAttr = new AdditiveAttribute(
SMILUtil.getMotionFakeAttributeName(), "XML", "rect"
);
var gMotionBundles = [ // Bundle to test basic functionality (using default calcMode='paced') new TestcaseBundle(gMotionAttr, [ // Basic paced-mode (default) test, with values/mpath/path new AnimMotionTestcase(
{ values: "100, 200; 120, 220; 130, 210" },
_reusedCTMLists.pacedBasic
), new AnimMotionTestcase(
{ path: "M100 200 L120 220 L130 210" },
_reusedCTMLists.pacedBasic
), new AnimMotionTestcase(
{ mpath: "M100 200 L120 220 L130 210" },
_reusedCTMLists.pacedBasic
),
// ..and now with rotate=constant value in degrees new AnimMotionTestcase(
{ values: "100,200; 120,220; 130, 210", rotate: "60" },
_reusedCTMLists.pacedR60
), new AnimMotionTestcase(
{ path: "M100 200 L120 220 L130 210", rotate: "60" },
_reusedCTMLists.pacedR60
), new AnimMotionTestcase(
{ mpath: "M100 200 L120 220 L130 210", rotate: "60" },
_reusedCTMLists.pacedR60
),
// ..and now with rotate=constant value in radians new AnimMotionTestcase(
{ path: "M100 200 L120 220 L130 210", rotate: "1.0471975512rad" }, // pi/3
_reusedCTMLists.pacedR60
),
// ..and now with rotate=auto new AnimMotionTestcase(
{ values: "100,200; 120,220; 130, 210", rotate: "auto" },
_reusedCTMLists.pacedRAuto
), new AnimMotionTestcase(
{ path: "M100 200 L120 220 L130 210", rotate: "auto" },
_reusedCTMLists.pacedRAuto
), new AnimMotionTestcase(
{ mpath: "M100 200 L120 220 L130 210", rotate: "auto" },
_reusedCTMLists.pacedRAuto
),
// ..and now with rotate=auto-reverse new AnimMotionTestcase(
{ values: "100,200; 120,220; 130, 210", rotate: "auto-reverse" },
_reusedCTMLists.pacedRAutoReverse
), new AnimMotionTestcase(
{ path: "M100 200 L120 220 L130 210", rotate: "auto-reverse" },
_reusedCTMLists.pacedRAutoReverse
), new AnimMotionTestcase(
{ mpath: "M100 200 L120 220 L130 210", rotate: "auto-reverse" },
_reusedCTMLists.pacedRAutoReverse
),
]),
// Bundle to test calcMode='discrete' new TestcaseBundle(gMotionAttr, [ new AnimMotionTestcase(
{ values: "100, 200; 120, 220; 130, 210", calcMode: "discrete" },
_reusedCTMLists.discreteBasic
), new AnimMotionTestcase(
{ path: "M100 200 L120 220 L130 210", calcMode: "discrete" },
_reusedCTMLists.discreteBasic
), new AnimMotionTestcase(
{ mpath: "M100 200 L120 220 L130 210", calcMode: "discrete" },
_reusedCTMLists.discreteBasic
), // ..and now with rotate=auto new AnimMotionTestcase(
{
values: "100, 200; 120, 220; 130, 210",
calcMode: "discrete",
rotate: "auto",
},
_reusedCTMLists.discreteRAuto
), new AnimMotionTestcase(
{
path: "M100 200 L120 220 L130 210",
calcMode: "discrete",
rotate: "auto",
},
_reusedCTMLists.discreteRAuto
), new AnimMotionTestcase(
{
mpath: "M100 200 L120 220 L130 210",
calcMode: "discrete",
rotate: "auto",
},
_reusedCTMLists.discreteRAuto
),
]),
// Bundle to test relative units ('em') new TestcaseBundle(gMotionAttr, [ // First with unitless values from->by... new AnimMotionTestcase(
{ from: "10, 10", by: "30, 60" },
{
ctm0: [10, 10, 0],
ctm1_6: [15, 20, 0],
ctm1_3: [20, 30, 0],
ctm2_3: [30, 50, 0],
ctm1: [40, 70, 0],
}
), // ... then add 'em' units (with 1em=10px) on half the values new AnimMotionTestcase(
{ from: "1em, 10", by: "30, 6em" },
{
ctm0: [10, 10, 0],
ctm1_6: [15, 20, 0],
ctm1_3: [20, 30, 0],
ctm2_3: [30, 50, 0],
ctm1: [40, 70, 0],
}
),
]),
// Bundle to test a path with just a "move" command and nothing else new TestcaseBundle(gMotionAttr, [ new AnimMotionTestcase({ values: "40, 80" }, _reusedCTMLists.justMoveBasic), new AnimMotionTestcase({ path: "M40 80" }, _reusedCTMLists.justMoveBasic), new AnimMotionTestcase({ mpath: "m40 80" }, _reusedCTMLists.justMoveBasic),
]), // ... and now with a fixed rotate-angle new TestcaseBundle(gMotionAttr, [ new AnimMotionTestcase(
{ values: "40, 80", rotate: "60" },
_reusedCTMLists.justMoveR60
), new AnimMotionTestcase(
{ path: "M40 80", rotate: "60" },
_reusedCTMLists.justMoveR60
), new AnimMotionTestcase(
{ mpath: "m40 80", rotate: "60" },
_reusedCTMLists.justMoveR60
),
]), // ... and now with 'auto' (should use the move itself as // our tangent angle, I think) new TestcaseBundle(gMotionAttr, [ new AnimMotionTestcase(
{ values: "40, 80", rotate: "auto" },
_reusedCTMLists.justMoveRAuto
), new AnimMotionTestcase(
{ path: "M40 80", rotate: "auto" },
_reusedCTMLists.justMoveRAuto
), new AnimMotionTestcase(
{ mpath: "m40 80", rotate: "auto" },
_reusedCTMLists.justMoveRAuto
),
]), // ... and now with 'auto-reverse' new TestcaseBundle(gMotionAttr, [ new AnimMotionTestcase(
{ values: "40, 80", rotate: "auto-reverse" },
_reusedCTMLists.justMoveRAutoReverse
), new AnimMotionTestcase(
{ path: "M40 80", rotate: "auto-reverse" },
_reusedCTMLists.justMoveRAutoReverse
), new AnimMotionTestcase(
{ mpath: "m40 80", rotate: "auto-reverse" },
_reusedCTMLists.justMoveRAutoReverse
),
]), // ... and now with a null move to make sure 'auto'/'auto-reverse' don't // blow up new TestcaseBundle(gMotionAttr, [ new AnimMotionTestcase(
{ values: "0, 0", rotate: "auto" },
_reusedCTMLists.nullMoveBasic
),
]), new TestcaseBundle(gMotionAttr, [ new AnimMotionTestcase(
{ values: "0, 0", rotate: "auto-reverse" },
_reusedCTMLists.nullMoveRAutoReverse
),
]),
];
// XXXdholbert Add more tests: // - keyPoints/keyTimes // - paths with curves // - Control path with from/by/to
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.