| 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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 | 661 |
| 662 assertEquals(0, event1.start); | 662 assertEquals(0, event1.start); |
| 663 assertEquals(1, event1.end); | 663 assertEquals(1, event1.end); |
| 664 | 664 |
| 665 assertEquals(0, event2.start); | 665 assertEquals(0, event2.start); |
| 666 assertEquals(1, event2.end); | 666 assertEquals(1, event2.end); |
| 667 | 667 |
| 668 assertEquals(1, event3.start); | 668 assertEquals(1, event3.start); |
| 669 assertEquals(1, event3.end); | 669 assertEquals(1, event3.end); |
| 670 }); | 670 }); |
| 671 |
| 672 TEST_F('CvoxEditableTextUnitTest', 'ContentEditableBraille', function() { |
| 673 this.loadDoc(function() {/*! |
| 674 <div id='1' contenteditable='true'> |
| 675 Some text.<br><br> |
| 676 After blank line. |
| 677 </div> |
| 678 */}); |
| 679 var element = $('1'); |
| 680 element.focus(); |
| 681 var editable = new cvox.ChromeVoxEditableContentEditable( |
| 682 element, new TestTts()); |
| 683 var firstLine = 'Some text.\n'; |
| 684 for (var i = 0; i < firstLine.length; ++i) { |
| 685 editable.update(true); |
| 686 TestBraille.assertContent(firstLine, i, i); |
| 687 window.getSelection().modify('move', 'forward', 'character'); |
| 688 } |
| 689 // We should have crossed the line break to the second line which is blank. |
| 690 editable.update(true); |
| 691 TestBraille.assertContent('', 0, 0); |
| 692 }); |
| OLD | NEW |