aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/css/css-animations/support/testcommon.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/css/css-animations/support/testcommon.js')
-rw-r--r--tests/wpt/web-platform-tests/css/css-animations/support/testcommon.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/css/css-animations/support/testcommon.js b/tests/wpt/web-platform-tests/css/css-animations/support/testcommon.js
index 7d63d2c49bc..e26a7a1858a 100644
--- a/tests/wpt/web-platform-tests/css/css-animations/support/testcommon.js
+++ b/tests/wpt/web-platform-tests/css/css-animations/support/testcommon.js
@@ -192,6 +192,15 @@ function waitForAnimationFrames(frameCount, onFrame) {
}
/**
+ * Timeout function used for tests with EventWatchers when all animation events
+ * should be received on the next animation frame. If two frames pass before
+ * receiving the expected events, then we can immediate fail the test.
+ */
+function fastEventsTimeout() {
+ return waitForAnimationFrames(2);
+};
+
+/**
* Wrapper that takes a sequence of N animations and returns:
*
* Promise.all([animations[0].ready, animations[1].ready, ... animations[N-1].ready]);