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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/Selection/use-counters.html

Issue 1509353004: Add UseCounters for Selection methods that take null (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/DOMSelection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/DOMSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698