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

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

Issue 2493873002: Introduce Internals#replaceMisspelled() and Internals#setMarker() (Closed)
Patch Set: add layout test 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
3 <script src='../../resources/testharness.js'></script>
4 <script src='../../resources/testharnessreport.js'></script>
5 <script src='../../editing/assert_selection.js'></script>
6 <script>
7 test(function () {
8 assert_not_equals(window.internals, undefined,
9 'This test requires internals.');
10 assert_selection(
11 '<div contenteditable="true">^appla| </div>',
yosin_UTC9 2016/11/14 02:28:17 nit: we don't need to have |="true"|
12 selection => {
13 let document = selection.document;
yosin_UTC9 2016/11/14 02:28:17 nit: s/let/const/
14 let begin = selection.anchorOffset;
yosin_UTC9 2016/11/14 02:28:17 nit: s/let/const/ nit: s/begin/start/ We usually
15 let end = selection.focusOffset;
yosin_UTC9 2016/11/14 02:28:17 nit: s/let/const/
16 assert_false(internals.hasSpellingMarker(document, begin, end));
17 internals.setMarker(document, selection.getRangeAt(0), 'Spelling');
18 assert_true(internals.hasSpellingMarker(document, begin, end));
19 internals.replaceMisspelled(document, 'apple');
20 },
21 '<div contenteditable="true">apple| </div>'
22 );
23 }, 'test setMarker and replaceMisspelled in internals');
24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698