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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/extend-by-character-005.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: 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
1 <html> 1 <!DOCTYPE html>
2 <head> 2 <script src="../../resources/testharness.js"></script>
3 3 <script src="../../resources/testharnessreport.js"></script>
4 <style>
5 .editing {
6 border: 2px solid red;
7 padding: 12px;
8 font-size: 24px;
9 }
10 </style>
11 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script >
12
13 <script>
14
15 function editingTest() {
16 for (i = 0; i < 159; i++) {
17 extendSelectionForwardByCharacterCommand();
18 }
19 for (i = 0; i < 158; i++) {
20 extendSelectionBackwardByCharacterCommand();
21 }
22 }
23
24 </script>
25
26 <title>Editing Test</title>
27 </head>
28 <body> 4 <body>
29 <div contenteditable id="root" class="editing"> 5 <div contenteditable id="root" class="editing">
30 <span id="test"><i>F and seven</i> years <b> as </b>our fathers f upon this 6 <span id="span"><i>F and seven</i> years <b> as </b>our fathers f upon this
31 continent, a new nation, conceived &nbsp;&nbsp; in Liberty, and dedicated to the 7 continent, a new nation, conceived &nbsp;&nbsp; in Liberty, and dedicated to the
32 proposition that all 8 proposition that all
33 <br>men are created equal.</span> 9 <br>men are created equal.</span>
34 </div> 10 </div>
35 11 <div id="log"></div>
36 <script> 12 <script>
37 runEditingTest(); 13 test(function () {
14 var selection = getSelection();
15 selection.collapse(span.firstChild.firstChild, 0);
16 for (i = 0; i < 159; i++) {
17 selection.modify("extend", "forward", "character");
18 }
19 for (i = 0; i < 158; i++) {
20 selection.modify("extend", "backward", "character");
21 }
22 assert_equals(selection.anchorNode, span.firstChild.firstChild);
23 assert_equals(selection.anchorOffset, 0);
24 assert_equals(selection.focusNode, span.firstChild.firstChild);
25 assert_equals(selection.focusOffset, 1);
26 });
38 </script> 27 </script>
39 28
40 </body> 29 </body>
41 </html> 30
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698