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

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

Issue 2493873002: Introduce Internals#replaceMisspelled() and Internals#setMarker() (Closed)
Patch Set: for yosin's nit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..45ac9533bb09ee0b47cc129d73b44e9509baec3c
--- /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>^appla| </div>',
+ selection => {
+ const document = selection.document;
+ const start = selection.anchorOffset;
+ const end = selection.focusOffset;
+ assert_false(internals.hasSpellingMarker(document, start, end));
+ internals.setMarker(document, selection.getRangeAt(0), 'Spelling');
+ assert_true(internals.hasSpellingMarker(document, start, end));
+ internals.replaceMisspelled(document, 'apple');
+ },
+ '<div contenteditable>apple| </div>'
+ );
+}, 'test setMarker and replaceMisspelled in internals');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698