mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
Update web-platform-tests to revision ad219567030d1f99f7310f52a17546b57b70d29e
This commit is contained in:
parent
2c63d1296b
commit
a7e62acbe8
129 changed files with 4156 additions and 590 deletions
|
@ -72,7 +72,15 @@
|
|||
// notifications.
|
||||
function waitForNotification(t, f) {
|
||||
requestAnimationFrame(function() {
|
||||
requestAnimationFrame(function() { t.step_timeout(f); });
|
||||
requestAnimationFrame(function() { t.step_timeout(f, 0); });
|
||||
});
|
||||
}
|
||||
|
||||
// If you need to wait until the IntersectionObserver algorithm has a chance
|
||||
// to run, but don't need to wait for delivery of the notifications...
|
||||
function waitForFrame(t, f) {
|
||||
requestAnimationFrame(function() {
|
||||
t.step_timeout(f, 0);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -85,9 +93,19 @@ function waitForNotification(t, f) {
|
|||
//
|
||||
// Following these rules will ensure that the test suite will not abort before
|
||||
// all test steps have run.
|
||||
function runTestCycle(f, description) {
|
||||
//
|
||||
// If the 'delay' parameter to the IntersectionObserver constructor is used,
|
||||
// tests will need to add the same delay to their runTestCycle invocations, to
|
||||
// wait for notifications to be generated and delivered.
|
||||
function runTestCycle(f, description, delay) {
|
||||
async_test(function(t) {
|
||||
waitForNotification(t, t.step_func_done(f));
|
||||
if (delay) {
|
||||
step_timeout(() => {
|
||||
waitForNotification(t, t.step_func_done(f));
|
||||
}, delay);
|
||||
} else {
|
||||
waitForNotification(t, t.step_func_done(f));
|
||||
}
|
||||
}, description);
|
||||
}
|
||||
|
||||
|
@ -174,4 +192,4 @@ function checkJsonEntries(actual, expected, description) {
|
|||
function checkIsIntersecting(entries, i, expected) {
|
||||
assert_equals(entries[i].isIntersecting, expected,
|
||||
'entries[' + i + '].target.isIntersecting equals ' + expected);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue