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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/modify_extend/extend-by-character-004.html

Issue 1798413003: [Editing][CodeHealth] Use w3c testharness in editing/seletion/extend-by-* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 9 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: third_party/WebKit/LayoutTests/editing/selection/modify_extend/extend-by-character-004.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/modify_extend/extend-by-character-004.html b/third_party/WebKit/LayoutTests/editing/selection/modify_extend/extend-by-character-004.html
new file mode 100644
index 0000000000000000000000000000000000000000..af2a9204f3bf2a57a8b75f54c2ca5be13dd5c153
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/modify_extend/extend-by-character-004.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<body>
+<div contenteditable id="root" class="editing">
+<span id="span">a<img src="../../resources/abe.png">new
+<br>nation <i> </i> <img src="../../resources/abe.png"> conceived
+<br>nation<img src="../../resources/abe.png"></span>
+</div>
+<div id="log"></div>
+<script>
+test(function () {
+ var selection = getSelection();
+ selection.collapse(span.firstChild, 0);
+ for (i = 0; i < 33; i++) {
+ selection.modify("extend", "forward", "character");
+ }
+ for (i = 0; i < 30; i++) {
+ selection.modify("extend", "backward", "character");
+ }
+ assert_equals(selection.anchorNode, span.firstChild);
+ assert_equals(selection.anchorOffset, 0);
+ assert_equals(selection.focusNode, span.childNodes[2]);
+ assert_equals(selection.focusOffset, 1);
+});
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698