| OLD | NEW |
| 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 Loading... |
| 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 }); |
| OLD | NEW |