gecko-dev/testing/web-platform/tests/web-animations/resources/timing-utils.js
Brian Birtles 08d941704d Bug 1445877 [wpt PR 10047] - [web-animations] Update timing interfaces, a=testonly
Automatic update from web-platform-tests[web-animations] Update timing interfaces (#10047)

This updates the tests to reflect the specification changes made in 953041faa3

wpt-commits: b73f249d95a82118603f749c266d540e0b4b3b04
wpt-pr: 10047
wpt-commits: b73f249d95a82118603f749c266d540e0b4b3b04
wpt-pr: 10047
2018-04-15 08:32:44 +01:00

39 lines
829 B
JavaScript

'use strict';
// =======================================
//
// Utility functions for testing timing
//
// =======================================
// ------------------------------
// Helper functions
// ------------------------------
// Utility function to check that a subset of timing properties have their
// default values.
function assert_default_timing_except(effect, propertiesToSkip) {
const defaults = {
delay: 0,
endDelay: 0,
fill: 'auto',
iterationStart: 0,
iterations: 1,
duration: 'auto',
direction: 'normal',
easing: 'linear',
};
for (const prop of Object.keys(defaults)) {
if (propertiesToSkip.includes(prop)) {
continue;
}
assert_equals(
effect.getTiming()[prop],
defaults[prop],
`${prop} parameter has default value:`
);
}
}