| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 /** @override */ | 107 /** @override */ |
| 108 setUp: function() { | 108 setUp: function() { |
| 109 // TODO: These tests are all assuming we used the IBeam cursor. | 109 // TODO: These tests are all assuming we used the IBeam cursor. |
| 110 // We need to add coverage for block cursor. | 110 // We need to add coverage for block cursor. |
| 111 cvox.ChromeVoxEditableTextBase.useIBeamCursor = true; | 111 cvox.ChromeVoxEditableTextBase.useIBeamCursor = true; |
| 112 cvox.ChromeVox.typingEcho = cvox.TypingEcho.CHARACTER_AND_WORD; | 112 cvox.ChromeVox.typingEcho = cvox.TypingEcho.CHARACTER_AND_WORD; |
| 113 cvox.ChromeVoxEditableTextBase.eventTypingEcho = false; | 113 cvox.ChromeVoxEditableTextBase.eventTypingEcho = false; |
| 114 cvox.ChromeVox.braille = new TestBraille(); | 114 cvox.ChromeVox.braille = new TestBraille(); |
| 115 | 115 |
| 116 /** Simple mock. */ | 116 /** Simple mock. */ |
| 117 cvox.ChromeVox.msgs = {}; | 117 Msgs = {}; |
| 118 | 118 |
| 119 /** | 119 /** |
| 120 * Simply return the message id. | 120 * Simply return the message id. |
| 121 * @param {string} msg Message id. | 121 * @param {string} msg Message id. |
| 122 * @return {string} Message id. | 122 * @return {string} Message id. |
| 123 */ | 123 */ |
| 124 cvox.ChromeVox.msgs.getMsg = function(msg) { | 124 Msgs.getMsg = function(msg) { |
| 125 return msg; | 125 return msg; |
| 126 }; | 126 }; |
| 127 }, | 127 }, |
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * Sets up for a cursor movement test. | 130 * Sets up for a cursor movement test. |
| 131 * @param {string} tagName Desired tag name, "input" or "textarea". | 131 * @param {string} tagName Desired tag name, "input" or "textarea". |
| 132 * @return {Object} object containing the editable element, and functions | 132 * @return {Object} object containing the editable element, and functions |
| 133 * to prepare, run the test, and tear down. | 133 * to prepare, run the test, and tear down. |
| 134 * @private | 134 * @private |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 }); |
| OLD | NEW |