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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak.html

Issue 2450373003: Convert editing/spelling/spelling-linebreak.html with spellcheck_test (Closed)
Patch Set: switch marker Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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> 4 <script src="../assert_selection.js"></script>
5 .editing { 5 <script src="spellcheck_test.js"></script>
6 border: 2px solid red;
7 padding: 12px;
8 font-size: 24px;
9 }
10 </style>
11 <script src="../../resources/js-test.js"></script>
12 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script >
13 6
14 <script> 7 <script>
15 8 spellcheck_test(
16 jsTestIsAsync = true; 9 '<div contenteditable>Hello,zz a |a</div>',
17 if (window.testRunner) 10 '',
18 testRunner.setMockSpellCheckerEnabled(true); 11 '<div contenteditable>Hello,#zz# a a</div>',
19 12 {
20 function editingTest() { 13 title: 'Has marker on initially misspelled word',
21 14 callback: sample => spellcheck_test(
22 var elem = document.getElementById("test"); 15 sample,
23 var selection = window.getSelection(); 16 'insertLineBreak',
24 selection.collapse(elem, elem.childNodes.length); 17 '<div contenteditable>Hello,#zz# a <br>a</div>',
25 18 'Markers are preserved after adding line break')
26 typeCharacterCommand('z'); 19 });
27 typeCharacterCommand('z');
28 typeCharacterCommand(' ');
29 typeCharacterCommand('a');
30 typeCharacterCommand(' ');
31 typeCharacterCommand('a');
32 moveSelectionBackwardByWordCommand();
33 insertLineBreakCommand();
34
35 if (window.testRunner) {
36 selection.collapse(elem, 0);
37 shouldBecomeEqual("internals.hasSpellingMarker(document, 6, 2)", "true", function() {
38 document.getElementById("root").style.display = "none";
39 finishJSTest();
40 });
41 }
42
43 }
44
45 </script> 20 </script>
46
47 <title>Editing Test</title>
48 </head>
49 <body>
50 <script>
51 description("Misspellings should be preserved when a line-break command "
52 + "splits a text node. You should see 'Hello,zz a' on the first line below, "
53 + "and 'a' on the second line. "
54 + "This test succeeds when 'zz' (and only 'zz') is marked as misspelled.");
55 </script>
56 <div contenteditable id="root" class="editing">
57 <!-- we need to lead "Hello," to preserve the marker even after collapse() -->
58 <span id="test">Hello,</span>
59 </div>
60 <script>
61 editingTest();
62 </script>
63 </body>
64 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/spelling/spelling-linebreak-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698