aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/worklets/resources/worklet-test-utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/worklets/resources/worklet-test-utils.js')
-rw-r--r--tests/wpt/web-platform-tests/worklets/resources/worklet-test-utils.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/worklets/resources/worklet-test-utils.js b/tests/wpt/web-platform-tests/worklets/resources/worklet-test-utils.js
new file mode 100644
index 00000000000..4912dadb9d5
--- /dev/null
+++ b/tests/wpt/web-platform-tests/worklets/resources/worklet-test-utils.js
@@ -0,0 +1,8 @@
+// Returns a reference to a worklet object corresponding to a given type.
+function get_worklet(type) {
+ if (type == 'paint')
+ return CSS.paintWorklet;
+ if (type == 'animation')
+ return window.animationWorklet;
+ return undefined;
+}