Index: third_party/WebKit/LayoutTests/editing/selection/type-checking.html |
diff --git a/third_party/WebKit/LayoutTests/editing/selection/type-checking.html b/third_party/WebKit/LayoutTests/editing/selection/type-checking.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..da265cb41c51b754192c02d1aa2a922f753473d0 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/editing/selection/type-checking.html |
@@ -0,0 +1,26 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/js-test.js"></script> |
+<body> |
+<script> |
+window.selection = getSelection(); |
+ |
+shouldNotThrow('selection.collapse(document.body, 0)'); |
+shouldNotThrow('selection.collapse(null, 0)'); |
+shouldNotThrow('selection.collapse(undefined, 0)'); |
+shouldThrow('selection.collapse(0, 0)'); |
+shouldThrow('selection.collapse(window, 0)'); |
+ |
+shouldNotThrow('selection.setPosition(document.body, 0)'); |
+shouldNotThrow('selection.setPosition(null, 0)'); |
+shouldNotThrow('selection.setPosition(undefined, 0)'); |
+shouldThrow('selection.setPosition(0, 0)'); |
+shouldThrow('selection.setPosition(window, 0)'); |
+ |
+shouldNotThrow('selection.setBaseAndExtent(document.body, 0, document.body, 0)'); |
+shouldNotThrow('selection.setBaseAndExtent(null, 0, null, 0)'); |
+shouldNotThrow('selection.setBaseAndExtent(undefined, 0, undefined, 0)'); |
+shouldThrow('selection.setBaseAndExtent(0, 0, null, 0)'); |
+shouldThrow('selection.setBaseAndExtent(null, 0, 0, 0)'); |
+shouldThrow('selection.setBaseAndExtent(window, 0, null, 0)'); |
+shouldThrow('selection.setBaseAndExtent(null, 0, window, 0)'); |
+</script> |