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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/extend-by-character-002.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 < 33; i++) {
17 extendSelectionForwardByCharacterCommand();
18 }
19 }
20
21 </script>
22
23 <title>Editing Test</title>
24 </head>
25 <body> 4 <body>
26 <div contenteditable id="root" class="editing"> 5 <div contenteditable id="root" class="editing">
27 <span id="test">a<img src="../resources/abe.png">new 6 <span id="span">a<img src="../resources/abe.png">new
28 <br>nation <i> </i> <img src="../resources/abe.png"> 7 <br>nation <i> </i> <img src="../resources/abe.png">
29 8
30 9
31 conceived 10 conceived
32 <br>nation<img src="../resources/abe.png"></span> 11 <br>nation<img src="../resources/abe.png"></span>
33 </div> 12 </div>
34 13 <div id="log"></div>
35 <script> 14 <script>
36 runEditingTest(); 15 test(function () {
16 var selection = getSelection();
17 selection.collapse(span.firstChild, 0);
18 for (i = 0; i < 33; i++) {
19 selection.modify("extend", "forward", "character");
20 }
21 assert_equals(selection.anchorNode, span.firstChild);
22 assert_equals(selection.anchorOffset, 0);
23 assert_equals(selection.focusNode, span.childNodes[10]); // "nation" text
24 assert_equals(selection.focusOffset, 6);
25 });
37 </script> 26 </script>
38 27
39 </body> 28 </body>
40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698