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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/editable_text_test.unitjs

Issue 2104473003: Support Windows/Linux-style forward delete feedback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Include test fixture. 5 // Include test fixture.
6 GEN_INCLUDE(['../testing/chromevox_unittest_base.js']); 6 GEN_INCLUDE(['../testing/chromevox_unittest_base.js']);
7 7
8 /** 8 /**
9 * A TTS class implementing speak and stop methods intended only for testing. 9 * A TTS class implementing speak and stop methods intended only for testing.
10 * @constructor 10 * @constructor
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 obj.changed(new cvox.TextChangeEvent('Hello, Wor', 10, 10)); 219 obj.changed(new cvox.TextChangeEvent('Hello, Wor', 10, 10));
220 assertEqualStringArrays(['.', 'd', 'l'], tts.get()); 220 assertEqualStringArrays(['.', 'd', 'l'], tts.get());
221 221
222 // Forward-delete 222 // Forward-delete
223 obj.changed(new cvox.TextChangeEvent('Hello, Wor', 9, 9)); 223 obj.changed(new cvox.TextChangeEvent('Hello, Wor', 9, 9));
224 obj.changed(new cvox.TextChangeEvent('Hello, Wor', 8, 8)); 224 obj.changed(new cvox.TextChangeEvent('Hello, Wor', 8, 8));
225 obj.changed(new cvox.TextChangeEvent('Hello, Wor', 7, 7)); 225 obj.changed(new cvox.TextChangeEvent('Hello, Wor', 7, 7));
226 obj.changed(new cvox.TextChangeEvent('Hello, or', 7, 7)); 226 obj.changed(new cvox.TextChangeEvent('Hello, or', 7, 7));
227 obj.changed(new cvox.TextChangeEvent('Hello, r', 7, 7)); 227 obj.changed(new cvox.TextChangeEvent('Hello, r', 7, 7));
228 obj.changed(new cvox.TextChangeEvent('Hello, ', 7, 7)); 228 obj.changed(new cvox.TextChangeEvent('Hello, ', 7, 7));
229 assertEqualStringArrays(['r', 'o', 'W', 'W', 'o', 'r'], tts.get()); 229 assertEqualStringArrays(['r', 'o', 'W', 'o', 'r'], tts.get());
230 230
231 // Clear all 231 // Clear all
232 obj.changed(new cvox.TextChangeEvent('', 0, 0)); 232 obj.changed(new cvox.TextChangeEvent('', 0, 0));
233 assertEqualStringArrays(['Hello, , deleted'], tts.get()); 233 assertEqualStringArrays(['Hello, , deleted'], tts.get());
234 234
235 // Paste / insert a whole word 235 // Paste / insert a whole word
236 obj.changed(new cvox.TextChangeEvent('Hello', 5, 5)); 236 obj.changed(new cvox.TextChangeEvent('Hello', 5, 5));
237 assertEqualStringArrays(['Hello'], tts.get()); 237 assertEqualStringArrays(['Hello'], tts.get());
238 obj.changed(new cvox.TextChangeEvent('Hello, World', 12, 12)); 238 obj.changed(new cvox.TextChangeEvent('Hello, World', 12, 12));
239 assertEqualStringArrays([', World'], tts.get()); 239 assertEqualStringArrays([', World'], tts.get());
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 var firstLine = 'Some text.\n'; 684 var firstLine = 'Some text.\n';
685 for (var i = 0; i < firstLine.length; ++i) { 685 for (var i = 0; i < firstLine.length; ++i) {
686 editable.update(true); 686 editable.update(true);
687 TestBraille.assertContent(firstLine, i, i); 687 TestBraille.assertContent(firstLine, i, i);
688 window.getSelection().modify('move', 'forward', 'character'); 688 window.getSelection().modify('move', 'forward', 'character');
689 } 689 }
690 // We should have crossed the line break to the second line which is blank. 690 // We should have crossed the line break to the second line which is blank.
691 editable.update(true); 691 editable.update(true);
692 TestBraille.assertContent('', 0, 0); 692 TestBraille.assertContent('', 0, 0);
693 }); 693 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698