OLD | NEW |
---|---|
1 <!doctype html> | 1 <!doctype html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
4 <script src="../assert_selection.js"></script> | 4 <script src="../assert_selection.js"></script> |
5 <script src="spellcheck_test.js"></script> | 5 <script src="spellcheck_test.js"></script> |
6 | 6 |
7 <script> | 7 <script> |
8 // This file tests the functionality of spellcheck_test.js | 8 // This file tests the functionality of spellcheck_test.js |
9 | 9 |
10 test( | 10 spellcheck_test( |
11 () => spellingMarker(0, 1, 'description').assertValid(), | 11 '<div contenteditable>|</div>', |
12 'spellingMarker returns valid Marker.'); | 12 'insertText zz.', |
13 | 13 '<div contenteditable>__.</div>', |
yosin_UTC9
2016/10/25 09:41:10
How about having expected selection?
spellcheck_t
Xiaocheng
2016/10/25 13:19:16
I don't think it makes too much sense to verify se
| |
14 test( | 14 'Mark misspellings after typing.'); |
15 () => grammarMarker(0, 1, 'description').assertValid(), | |
16 'grammarMarker returns valid Marker.'); | |
17 | 15 |
18 spellcheck_test( | 16 spellcheck_test( |
19 '<div contentEditable>|</div>', | 17 '<div contenteditable>|</div>', |
20 'insertText wellcome.', | 18 'insertText You has the right.', |
21 spellingMarker(0, 8, 'welcome'), // 'wellcome' | 19 '<div contenteditable>You ~~~ the right.</div>', |
22 'Mark misspellings and give replacement suggestions after typing.'); | 20 'Mark ungrammatical phrases after typing.'); |
23 | 21 |
24 spellcheck_test( | 22 spellcheck_test( |
25 '<div contentEditable>|</div>', | 23 '<div contenteditable>|</div>', |
26 'insertText zz zz.', | 24 'insertText orange,zz,apple.', |
27 [spellingMarker(0, 2), spellingMarker(3, 2)], // Both 'zz's | 25 // Grammar marker under the whole sentence, and spelling marker under 'zz'. |
28 'Mark multiple misspellings after typing.'); | 26 '<div contenteditable>~~~~~~~##~~~~~~~</div>', |
27 'Mark overlapping grammer and spelling errors.'); | |
29 | 28 |
29 // TODO(editing-dev): Make initial selection work for TEXTAREA. | |
30 spellcheck_test( | 30 spellcheck_test( |
31 '<div contentEditable>|</div>', | 31 '<textarea>|</textarea>', |
32 'insertText You has the right.', | 32 document => { |
33 grammarMarker(4, 3), // 'has' | 33 document.querySelector('textarea').focus(); |
34 'Mark ungrammatical phrases after typing.'); | 34 document.execCommand('insertText', false, 'zz.'); |
35 }, | |
36 '<textarea>__.</textarea>', | |
37 'Mark misspellings in <textarea>.'); | |
38 | |
39 // TODO(editing-dev): Make initial selection work for INPUT. | |
40 spellcheck_test( | |
41 '<input type="text">|', | |
42 document => { | |
43 document.querySelector('input').focus(); | |
44 document.execCommand('insertText', false, 'asd.'); | |
45 }, | |
46 '<input type="text" value="___.">', | |
47 'Mark misspellings in <input>.'); | |
35 </script> | 48 </script> |
OLD | NEW |