Index: third_party/WebKit/LayoutTests/fast/dom/Selection/use-counters.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Selection/use-counters.html b/third_party/WebKit/LayoutTests/fast/dom/Selection/use-counters.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9682116edb86c062b16f7df8e59fc87722c7ba49 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/Selection/use-counters.html |
@@ -0,0 +1,23 @@ |
+<!DOCTYPE html> |
+<title>Selection UseCounters</title> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script> |
+test(function() { |
+ var SelectionCollapseNull = 1083; // From UseCounter.h |
+ assert_false(internals.isUseCounted(document, SelectionCollapseNull)); |
+ document.getSelection().collapse(null, -1); |
+ assert_true(internals.isUseCounted(document, SelectionCollapseNull)); |
+}, 'selection.collapse(null, -1)'); |
+ |
+test(function() { |
+ var SelectionSetBaseAndExtentNull = 1084; // From UseCounter.h |
+ assert_false(internals.isUseCounted(document, SelectionSetBaseAndExtentNull)); |
+ assert_throws('IndexSizeError', function() { |
+ document.getSelection().setBaseAndExtent(null, -1, null, -1); |
+ }); |
+ assert_false(internals.isUseCounted(document, SelectionSetBaseAndExtentNull)); |
+ document.getSelection().setBaseAndExtent(null, 0, null, 0) |
+ assert_true(internals.isUseCounted(document, SelectionSetBaseAndExtentNull)); |
+}, 'selection.setBaseAndExtent(null, 0, null, 0)'); |
+</script> |