Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-creation.html

Issue 2873493002: Basic ScrollTimeline implementation for Animation Worklet (Closed)
Patch Set: address reviewer nits Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-creation.html
diff --git a/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-creation.html b/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-creation.html
new file mode 100644
index 0000000000000000000000000000000000000000..bc26e2dfdf286ac60d77f604926b7a5098ee74b2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-creation.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<style>
+.scroller {
+ height: 100px;
+ width: 100px;
+ overflow: scroll;
+}
+
+.content {
+ height: 500px;
+ width: 500px;
+}
+</style>
+
+<div class='scroller'>
+ <div class='content'></div>
+</div>
+
+<script src='../../../resources/testharness.js'></script>
+<script src='../../../resources/testharnessreport.js'></script>
+<script>
+test(function() {
+ const scroller = document.querySelector('.scroller');
+ const scrollTimeline = new ScrollTimeline(
+ { scrollSource: scroller, timeRange: 100, orientation: 'inline' });
+
+ assert_equals(scrollTimeline.scrollSource, scroller);
+ assert_equals(scrollTimeline.timeRange, 100);
+ assert_equals(scrollTimeline.orientation, 'inline');
+}, 'Basic ScrollTimeline creation should work');
+
+test(function() {
+ const scrollTimeline = new ScrollTimeline(
+ { timeRange: 100, orientation: 'block' });
+
+ assert_equals(scrollTimeline.scrollSource, document.scrollingElement);
+}, 'If the scrollSource is unspecified, use the document scrollingElement');
+
+test(function() {
+ const scroller = document.querySelector('.scroller');
+ const constructorFunc = function() { new ScrollTimeline(
+ { scrollSource: scroller, orientation: 'nonsense', timeRange: 100 }) };
+ assert_throws(TypeError(), constructorFunc);
+}, 'If the orientation is invalid, object construction should fail');
+
+// TODO(smcgruer): Remove once 'auto' timeRange is supported.
+test(function() {
+ const scroller = document.querySelector('.scroller');
+ const constructorFunc = function() { new ScrollTimeline(
+ { scrollSource: scroller, orientation: 'block' }) };
+ assert_throws('NotSupportedError', constructorFunc);
+}, 'If the timeRange is unspecified, object construction should fail');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/animation/scroll-animations/scrolltimeline-currenttime.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698