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

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

Issue 2399673005: Normalize non-breaking spaces into spaces (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/common/editable_text_base.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 var firstLine = 'Some text.\n'; 695 var firstLine = 'Some text.\n';
696 for (var i = 0; i < firstLine.length; ++i) { 696 for (var i = 0; i < firstLine.length; ++i) {
697 editable.update(true); 697 editable.update(true);
698 TestBraille.assertContent(firstLine, i, i); 698 TestBraille.assertContent(firstLine, i, i);
699 window.getSelection().modify('move', 'forward', 'character'); 699 window.getSelection().modify('move', 'forward', 'character');
700 } 700 }
701 // We should have crossed the line break to the second line which is blank. 701 // We should have crossed the line break to the second line which is blank.
702 editable.update(true); 702 editable.update(true);
703 TestBraille.assertContent('', 0, 0); 703 TestBraille.assertContent('', 0, 0);
704 }); 704 });
705
706 TEST_F('CvoxEditableTextUnitTest', 'TypingNonBreakingSpaces', function() {
707 var tts = new TestTts();
708 var obj = new cvox.ChromeVoxEditableTextBase('Hello', 0, 0, false, tts);
709
710 obj.changed(new cvox.TextChangeEvent('h', 1, 1));
711 obj.changed(new cvox.TextChangeEvent('hi', 2, 2));
712 obj.changed(new cvox.TextChangeEvent('hi\u00a0', 3, 3));
713 obj.changed(new cvox.TextChangeEvent('hi t', 4, 4));
714 assertEqualStringArrays(['h', 'i', 'hi ', 't'], tts.get());
715 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/common/editable_text_base.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698