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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/misspellings.html

Issue 2709983005: Selection API: Do not change focus by Selection functions. (Closed)
Patch Set: . Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
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
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698