| 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 | 4 |
| 5 <!-- Layout tests use a mock spell checker with only a few words in its dictiona
ry. --> | 5 <!-- Layout tests use a mock spell checker with only a few words in its dictiona
ry. --> |
| 6 | 6 |
| 7 <div id="editable" contentEditable="true" spellcheck="true"></div> | 7 <div id="editable" contentEditable="true" spellcheck="true"></div> |
| 8 | 8 |
| 9 <p id="paragraph" tabIndex="0" spellcheck="true">Hi, how adaasj sdklj?</p> | 9 <p id="paragraph" tabIndex="0" spellcheck="true">Hi, how adaasj sdklj?</p> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 assert_equals(axStaticText.misspellingAtIndex(2), 'chello'); | 37 assert_equals(axStaticText.misspellingAtIndex(2), 'chello'); |
| 38 }, | 38 }, |
| 39 cleanup: () => document.getElementById('editable').style.display = 'none' | 39 cleanup: () => document.getElementById('editable').style.display = 'none' |
| 40 }); | 40 }); |
| 41 | 41 |
| 42 tests.push({ | 42 tests.push({ |
| 43 testObject: async_test('Misspellings should be reported in static text when
design mode is on.'), | 43 testObject: async_test('Misspellings should be reported in static text when
design mode is on.'), |
| 44 action: () => { | 44 action: () => { |
| 45 document.designMode = 'on'; | 45 document.designMode = 'on'; |
| 46 // Trigger spell checking on originally static text. | 46 // Trigger spell checking on originally static text. |
| 47 document.documentElement.focus(); |
| 47 window.getSelection().collapse(document.getElementById('paragraph'), 0); | 48 window.getSelection().collapse(document.getElementById('paragraph'), 0); |
| 48 }, | 49 }, |
| 49 verification: () => { | 50 verification: () => { |
| 50 var axParagraph = accessibilityController.accessibleElementById('paragraph
'); | 51 var axParagraph = accessibilityController.accessibleElementById('paragraph
'); |
| 51 var axStaticText = axParagraph.childAtIndex(0); | 52 var axStaticText = axParagraph.childAtIndex(0); |
| 52 | 53 |
| 53 assert_equals(axStaticText.misspellingsCount, 2); | 54 assert_equals(axStaticText.misspellingsCount, 2); |
| 54 assert_equals(axStaticText.misspellingAtIndex(0), 'adaasj'); | 55 assert_equals(axStaticText.misspellingAtIndex(0), 'adaasj'); |
| 55 assert_equals(axStaticText.misspellingAtIndex(1), 'sdklj'); | 56 assert_equals(axStaticText.misspellingAtIndex(1), 'sdklj'); |
| 56 }, | 57 }, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 setTimeout(() => { | 127 setTimeout(() => { |
| 127 if (window.testRunner) | 128 if (window.testRunner) |
| 128 testRunner.removeSpellCheckResolvedCallback(); | 129 testRunner.removeSpellCheckResolvedCallback(); |
| 129 testObject.cleanup(); | 130 testObject.cleanup(); |
| 130 runTestIfAny(); | 131 runTestIfAny(); |
| 131 }, 0); | 132 }, 0); |
| 132 }); | 133 }); |
| 133 | 134 |
| 134 runTestIfAny(); | 135 runTestIfAny(); |
| 135 </script> | 136 </script> |
| OLD | NEW |