Chromium Code Reviews| 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..da71e68379264fcd7f37d168f9829c0730cb074e |
| --- /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: auto; |
|
majidvp
2017/06/28 15:52:38
nit: In this case this it always overflows so it i
smcgruer
2017/06/29 15:23:22
Done.
|
| +} |
| + |
| +.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> |