diff options
author | WPT Sync Bot <josh+wptsync@joshmatthews.net> | 2023-04-07 01:27:34 +0000 |
---|---|---|
committer | WPT Sync Bot <josh+wptsync@joshmatthews.net> | 2023-04-07 01:30:49 +0000 |
commit | bb34f95b33cd3b919fda221408720e7e6dea84ab (patch) | |
tree | 33cdd834eba08cbc747015ba36d8180fa844d56f /tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js | |
parent | cfef75c99b89193bd82d44a6dffc35119ce7f8d0 (diff) | |
download | servo-bb34f95b33cd3b919fda221408720e7e6dea84ab.tar.gz servo-bb34f95b33cd3b919fda221408720e7e6dea84ab.zip |
Update web-platform-tests to revision b'1d9b01e2fad6af3a057d571b1e088e15fa9bc8e6'
Diffstat (limited to 'tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js')
-rw-r--r-- | tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js b/tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js index 8e6e5840f7f..60fb9781a0c 100644 --- a/tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js +++ b/tests/wpt/web-platform-tests/web-animations/resources/keyframe-utils.js @@ -31,8 +31,20 @@ function assert_frames_equal(a, b, name) { `properties on ${name} should match`); // Iterates sorted keys to ensure stable failures. for (const p of Object.keys(a).sort()) { - if (typeof a[p] == 'number') + if (typeof b[p] == 'number') assert_approx_equals(a[p], b[p], 1e-6, `value for '${p}' on ${name}`); + else if (typeof b[p] == 'object') { + for (const key in b[p]) { + if (typeof b[p][key] == 'number') { + assert_approx_equals(a[p][key], b[p][key], 1e-6, + `value for '${p}.${key}' on ${name}`); + } else { + assert_equals((a[p][key] || 'undefined').toString(), + b[p][key].toString(), + `value for '${p}.${key}' on ${name}`); + } + } + } else assert_equals(a[p], b[p], `value for '${p}' on ${name}`); } |