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

Unified Diff: LayoutTests/fast/text/selection-exceptions.html

Issue 22608004: Improve 'Selection' exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rewording. Created 7 years, 4 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/text/selection-exceptions.html
diff --git a/LayoutTests/fast/text/selection-exceptions.html b/LayoutTests/fast/text/selection-exceptions.html
new file mode 100644
index 0000000000000000000000000000000000000000..91c9724dd88f732a2a60c3bd4a9fe9ee41502b3e
--- /dev/null
+++ b/LayoutTests/fast/text/selection-exceptions.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+ <script src="../js/resources/js-test-pre.js"></script>
+ <script>
+ description("This tests that 'Selection' methods throw exceptions with reasonable messages.");
+
+ shouldThrow('getSelection().collapse(document.documentElement, -1)');
+
+ getSelection().empty();
+ shouldThrow('getSelection().collapseToStart()');
+ shouldThrow('getSelection().collapseToEnd()');
+
+ shouldThrow('getSelection().setBaseAndExtent(document.documentElement, -1, document.documentElement, 0)');
+ shouldThrow('getSelection().setBaseAndExtent(document.documentElement, 0, document.documentElement, -1)');
+
+ shouldThrow('getSelection().setPosition(document.documentElement, -1)');
+
+ shouldThrow('getSelection().getRangeAt(-1)');
+
+ shouldThrow('getSelection().extend(0, -1)');
+ shouldThrow('getSelection().extend(document.documentElement, -1)');
+ shouldThrow('getSelection().extend(document.documentElement, 1000)');
+ </script>
+ <script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698