Commit 75efa395 authored by xiaochengh's avatar xiaochengh Committed by Commit bot

Introduce spellcheck_test

This patch introduces |spellcheck_test| for writing asynchronous layout
tests for spellchecker in an intuitive manner, following the same spirit
of |assert_selection|.

This patch allows us to convert existing spellcheck tests easily as a
preparation for idle time spellchecker.

BUG=517298

Review-Url: https://codereview.chromium.org/2435273002
Cr-Commit-Position: refs/heads/master@{#427035}
parent eaaad984
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script src="spellcheck_test.js"></script>
<script>
// This file tests the functionality of spellcheck_test.js
test(
() => spellingMarker(0, 1, 'description').assertValid(),
'spellingMarker returns valid Marker.');
test(
() => grammarMarker(0, 1, 'description').assertValid(),
'grammarMarker returns valid Marker.');
spellcheck_test(
'<div contentEditable>|</div>',
'insertText wellcome.',
spellingMarker(0, 8, 'welcome'), // 'wellcome'
'Mark misspellings and give replacement suggestions after typing.');
spellcheck_test(
'<div contentEditable>|</div>',
'insertText zz zz.',
[spellingMarker(0, 2), spellingMarker(3, 2)], // Both 'zz's
'Mark multiple misspellings after typing.');
spellcheck_test(
'<div contentEditable>|</div>',
'insertText You has the right.',
grammarMarker(4, 3), // 'has'
'Mark ungrammatical phrases after typing.');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment