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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/modify_move/move-by-character-004.html

Issue 1809963002: [Editing][CodeHealth] Use w3c testharness in editing/seletion/move-by-* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <body>
5 <div contenteditable id="root" class="editing">
6 <span id="sample">a<img src="../../resources/abe.png">new
7 <br>nation <i> </i> <img src="../../resources/abe.png"> conceived
8 <br>nation<img src="../../resources/abe.png"></span>
9 </div>
10 <div id="log"></div>
11 <script>
12 test(function () {
13 var selection = window.getSelection();
14 selection.collapse(sample, 0);
15 for (i = 0; i < 33; ++i)
16 selection.modify('move', 'forward', 'character');
17 for (i = 0; i < 32; ++i)
18 selection.modify('move', 'backward', 'character');
19 assert_true(selection.isCollapsed, 'isCollapsed');
20 assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode');
21 assert_equals(selection.anchorOffset, 1, 'anchorOffset');
22 });
23 </script>
24
25 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698