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

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

Issue 2459553002: Convert editing/spelling/spelling-*-selection.html with spellcheck_test (Closed)
Patch Set: Also convert spelling-{subword,multiword}-selection.html 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script src="resources/util.js"></script>
6 </head>
7 <body>
8 <div id="container">
9 <div id="destination" contentEditable></div>
10 </div>
11
12 <script>
13
14 description("Spelling should be disabled when user selects a part of misspelling . " +
15 "To test manually, type 'wellcome home.' select 'llco', and context- click on the selection. " +
16 "The test suceeds when the context menu has no spell check suggestio ns.");
17
18 initSpellTest("destination", "wellcome home.", function(textNode) {
19 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
20 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
21 shouldBeEqualToString("window.getSelection().toString()", "");
22
23 // Select the text "llco".
24 var subWordRange = document.createRange();
25 subWordRange.setStart(textNode, 2);
26 subWordRange.setEnd(textNode, 6);
27 window.getSelection().removeAllRanges();
28 window.getSelection().addRange(subWordRange);
29
30 shouldBeEqualToString("window.getSelection().toString()", "llco");
31
32 // Context click on 'llco' to show the context menu.
33 var x = destination.offsetParent.offsetLeft + destination.offsetLeft + 40;
34 var y = destination.offsetParent.offsetTop + destination.offsetTop + destina tion.offsetHeight / 2;
35 eventSender.mouseMoveTo(x, y);
36 contextMenuElements = eventSender.contextClick();
37 // Esc key to hide the context menu.
38 eventSender.keyDown("Escape", null);
39
40 spellingMarkerRange = internals.markerRangeForNode(textNode, "spelling", 0);
41 shouldBeEqualToString("spellingMarkerRange.toString()", "wellcome");
42 shouldBeEqualToString("window.getSelection().toString()", "llco");
43 shouldBeEqualToString("contextMenuElements[contextMenuElements.length - 1]", "<separator>");
44 });
45
46 </script>
47 </body>
48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698