summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-animations/scroll-timelines
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/scroll-animations/scroll-timelines')
-rw-r--r--testing/web-platform/tests/scroll-animations/scroll-timelines/setting-timeline.tentative.html11
-rw-r--r--testing/web-platform/tests/scroll-animations/scroll-timelines/testcommon.js17
2 files changed, 17 insertions, 11 deletions
diff --git a/testing/web-platform/tests/scroll-animations/scroll-timelines/setting-timeline.tentative.html b/testing/web-platform/tests/scroll-animations/scroll-timelines/setting-timeline.tentative.html
index 5813de60fa..5502e13367 100644
--- a/testing/web-platform/tests/scroll-animations/scroll-timelines/setting-timeline.tentative.html
+++ b/testing/web-platform/tests/scroll-animations/scroll-timelines/setting-timeline.tentative.html
@@ -98,17 +98,6 @@ function assert_paused_times(animation, timeline_current_time,
}
}
-function createViewTimeline(t) {
- const parent = document.querySelector('.scroller');
- const elem = document.createElement('div');
- elem.id = 'target';
- t.add_cleanup(() => {
- elem.remove();
- });
- parent.appendChild(elem);
- return new ViewTimeline({ subject: elem });
-}
-
promise_test(async t => {
const scrollTimeline = createScrollTimeline(t);
await updateScrollPosition(scrollTimeline, 100);
diff --git a/testing/web-platform/tests/scroll-animations/scroll-timelines/testcommon.js b/testing/web-platform/tests/scroll-animations/scroll-timelines/testcommon.js
index 97e81f494c..88021409f1 100644
--- a/testing/web-platform/tests/scroll-animations/scroll-timelines/testcommon.js
+++ b/testing/web-platform/tests/scroll-animations/scroll-timelines/testcommon.js
@@ -85,6 +85,23 @@ function createScrollLinkedAnimationWithTiming(test, timing, timeline) {
new KeyframeEffect(createDiv(test), KEYFRAMES, timing), timeline);
}
+function createViewTimeline(t) {
+ const parent = document.querySelector('.scroller');
+ const elem = document.createElement('div');
+ elem.id = 'target';
+ t.add_cleanup(() => {
+ elem.remove();
+ });
+ parent.appendChild(elem);
+ return new ViewTimeline({ subject: elem });
+}
+
+function createAnimation(t) {
+ const elem = createDiv(t);
+ const animation = elem.animate({ opacity: [1, 0] }, 1000);
+ return animation;
+}
+
function assert_approx_equals_or_null(actual, expected, tolerance, name) {
if (actual === null || expected === null){
assert_equals(actual, expected, name);