mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Update web-platform-tests to revision 097043b336e46876e281ddec3bb014fe9c480128
This commit is contained in:
parent
ecd32570c0
commit
b68253eac0
405 changed files with 9164 additions and 3050 deletions
|
@ -5,6 +5,7 @@
|
|||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../testcommon.js"></script>
|
||||
<script src="../../resources/timing-override.js"></script>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
|
18
tests/wpt/web-platform-tests/web-animations/resources/timing-override.js
Executable file
18
tests/wpt/web-platform-tests/web-animations/resources/timing-override.js
Executable file
|
@ -0,0 +1,18 @@
|
|||
// Firefox implements unconditional clamping of 20 usec; and for certain web-animation tests,
|
||||
// we hit some test failures because the Time Precision is too small. We override these functions
|
||||
// on a per-test basis for Firefox only.
|
||||
if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1){
|
||||
window.assert_times_equal = (actual, expected, description) => {
|
||||
let TIME_PRECISION = 0.02;
|
||||
assert_approx_equals(actual, expected, TIME_PRECISION * 2, description);
|
||||
};
|
||||
|
||||
window.assert_time_equals_literal = (actual, expected, description) => {
|
||||
let TIME_PRECISION = 0.02;
|
||||
if (Math.abs(expected) === Infinity) {
|
||||
assert_equals(actual, expected, description);
|
||||
} else {
|
||||
assert_approx_equals(actual, expected, TIME_PRECISION, description);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../testcommon.js"></script>
|
||||
<script src="../../resources/timing-override.js"></script>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../testcommon.js"></script>
|
||||
<script src="../../resources/timing-override.js"></script>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
@ -262,7 +263,7 @@ promise_test(async t => {
|
|||
// calculated using the new playback rate
|
||||
assert_times_equal(anim.startTime,
|
||||
anim.timeline.currentTime - 25 * MS_PER_SEC);
|
||||
assert_time_equals_literal(anim.currentTime, 50 * MS_PER_SEC);
|
||||
assert_time_equals_literal(parseInt(anim.currentTime.toPrecision(5), 10), 50 * MS_PER_SEC);
|
||||
}, 'Setting the start time of a playing animation applies a pending playback rate');
|
||||
|
||||
</script>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../testcommon.js"></script>
|
||||
<script src="../../resources/timing-override.js"></script>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
<script>
|
||||
'use strict';
|
||||
|
||||
function matchUnconditionalClamping(timestamp) {
|
||||
return parseFloat((Math.floor(timestamp / .02) * .02).toPrecision(8), 10);
|
||||
}
|
||||
|
||||
async_test(t => {
|
||||
assert_greater_than_equal(document.timeline.currentTime, 0,
|
||||
'The current time is initially is positive or zero');
|
||||
|
@ -28,7 +32,7 @@ async_test(t => {
|
|||
// so we use requestAnimationFrame instead.
|
||||
window.requestAnimationFrame(rafTime => {
|
||||
t.step(() => {
|
||||
assert_equals(document.timeline.currentTime, rafTime,
|
||||
assert_equals(document.timeline.currentTime, matchUnconditionalClamping(rafTime),
|
||||
'The current time matches requestAnimationFrame time');
|
||||
});
|
||||
t.done();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue