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

Unified Diff: LayoutTests/fast/dom/Window/window-scroll-arguments.html

Issue 146003002: Bindings for CSSOM View smooth scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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
Index: LayoutTests/fast/dom/Window/window-scroll-arguments.html
diff --git a/LayoutTests/fast/dom/Window/window-scroll-arguments.html b/LayoutTests/fast/dom/Window/window-scroll-arguments.html
index 26855c37975409c0081953fa5ffbbb7ceaa4e3da..d2c9b253e38bdde1e744f21d29370482c4170494 100644
--- a/LayoutTests/fast/dom/Window/window-scroll-arguments.html
+++ b/LayoutTests/fast/dom/Window/window-scroll-arguments.html
@@ -25,7 +25,8 @@
reset();
description("This test makes sure that calling the window scrolling\
- methods with less than 2 arguments throws exception.");
+ methods with less than 2 arguments or with an invalid third argument\
+ throws an exception.");
// scrollTo /////////////////////////
debug('');
@@ -46,6 +47,16 @@
shouldBe('window.scrollY', 'y');
reset();
+ debug("Testing - scrollTo with a valid ScrollOptions argument");
+ shouldNotThrow('window.scrollTo(x, y, { })');
+ shouldNotThrow('window.scrollTo(x, y, { behavior: "auto" })');
+ shouldNotThrow('window.scrollTo(x, y, { behavior: "instant" })');
+ shouldNotThrow('window.scrollTo(x, y, { behavior: "smooth" })');
+
+ debug("Testing - scrollTo with an invalid ScrollOptions argument");
+ shouldThrow('window.scrollTo(x, y, { behavior: "" })');
+ shouldThrow('window.scrollTo(x, y, { behavior: "abcd" })');
+
// scroll /////////////////////////
debug('');
debug('window.scroll Tests');
@@ -65,6 +76,16 @@
shouldBe('window.scrollY', 'y');
reset();
+ debug("Testing - scroll with a valid ScrollOptions argument");
+ shouldNotThrow('window.scroll(x, y, { })');
+ shouldNotThrow('window.scroll(x, y, { behavior: "auto" })');
+ shouldNotThrow('window.scroll(x, y, { behavior: "instant" })');
+ shouldNotThrow('window.scroll(x, y, { behavior: "smooth" })');
+
+ debug("Testing - scroll with an invalid ScrollOptions argument");
+ shouldThrow('window.scroll(x, y, { behavior: "" })');
+ shouldThrow('window.scroll(x, y, { behavior: "abcd" })');
+
// scrollBy /////////////////////////
debug('');
debug('window.scrollBy Tests');
@@ -83,6 +104,16 @@
shouldBe('window.scrollX', 'resetX + x');
shouldBe('window.scrollY', 'resetY + y');
reset();
+
+ debug("Testing - scrollBy with a valid ScrollOptions argument");
+ shouldNotThrow('window.scrollBy(x, y, { })');
+ shouldNotThrow('window.scrollBy(x, y, { behavior: "auto" })');
+ shouldNotThrow('window.scrollBy(x, y, { behavior: "instant" })');
+ shouldNotThrow('window.scrollBy(x, y, { behavior: "smooth" })');
+
+ debug("Testing - scrollBy with an invalid ScrollOptions argument");
+ shouldThrow('window.scrollBy(x, y, { behavior: "" })');
+ shouldThrow('window.scrollBy(x, y, { behavior: "abcd" })');
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698