Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/editing/spelling/spellcheck-marker.html |
| diff --git a/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-marker.html b/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-marker.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a7d090b16b9fa1047eeada46b48cea1fab7015f3 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/editing/spelling/spellcheck-marker.html |
| @@ -0,0 +1,24 @@ |
| +<!DOCTYPE html> |
| + |
| +<script src='../../resources/testharness.js'></script> |
| +<script src='../../resources/testharnessreport.js'></script> |
| +<script src='../../editing/assert_selection.js'></script> |
| +<script> |
| +test(function () { |
| + assert_not_equals(window.internals, undefined, |
| + 'This test requires internals.'); |
| + assert_selection( |
| + '<div contenteditable="true">^appla| </div>', |
|
yosin_UTC9
2016/11/14 02:28:17
nit: we don't need to have |="true"|
|
| + selection => { |
| + let document = selection.document; |
|
yosin_UTC9
2016/11/14 02:28:17
nit: s/let/const/
|
| + let begin = selection.anchorOffset; |
|
yosin_UTC9
2016/11/14 02:28:17
nit: s/let/const/
nit: s/begin/start/
We usually
|
| + let end = selection.focusOffset; |
|
yosin_UTC9
2016/11/14 02:28:17
nit: s/let/const/
|
| + assert_false(internals.hasSpellingMarker(document, begin, end)); |
| + internals.setMarker(document, selection.getRangeAt(0), 'Spelling'); |
| + assert_true(internals.hasSpellingMarker(document, begin, end)); |
| + internals.replaceMisspelled(document, 'apple'); |
| + }, |
| + '<div contenteditable="true">apple| </div>' |
| + ); |
| +}, 'test setMarker and replaceMisspelled in internals'); |
| +</script> |