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 GEN_INCLUDE(['../testing/fake_objects.js']); | 8 GEN_INCLUDE(['../testing/fake_objects.js']); |
9 | 9 |
10 // Fake out the Chrome API namespace we depend on. | 10 // Fake out the Chrome API namespace we depend on. |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 */ | 384 */ |
385 function CvoxBrailleInputHandlerUnitTest() {} | 385 function CvoxBrailleInputHandlerUnitTest() {} |
386 | 386 |
387 CvoxBrailleInputHandlerUnitTest.prototype = { | 387 CvoxBrailleInputHandlerUnitTest.prototype = { |
388 __proto__: ChromeVoxUnitTestBase.prototype, | 388 __proto__: ChromeVoxUnitTestBase.prototype, |
389 | 389 |
390 /** @override */ | 390 /** @override */ |
391 closureModuleDeps: [ | 391 closureModuleDeps: [ |
392 'cvox.BrailleInputHandler', | 392 'cvox.BrailleInputHandler', |
393 'cvox.BrailleUtil', | 393 'cvox.BrailleUtil', |
394 'cvox.Spannable', | |
395 ], | 394 ], |
396 | 395 |
397 /** | 396 /** |
398 * Creates an editor and establishes a connection from the IME. | 397 * Creates an editor and establishes a connection from the IME. |
399 * @return {FakeEditor} | 398 * @return {FakeEditor} |
400 */ | 399 */ |
401 createEditor: function() { | 400 createEditor: function() { |
402 chrome.runtime.onConnectExternal.getListener()(this.port); | 401 chrome.runtime.onConnectExternal.getListener()(this.port); |
403 return new FakeEditor(this.port, this.inputHandler); | 402 return new FakeEditor(this.port, this.inputHandler); |
404 }, | 403 }, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 | 637 |
639 | 638 |
640 TEST_F('CvoxBrailleInputHandlerUnitTest', 'KeysImeNotActive', function() { | 639 TEST_F('CvoxBrailleInputHandlerUnitTest', 'KeysImeNotActive', function() { |
641 var editor = this.createEditor(); | 640 var editor = this.createEditor(); |
642 this.sendKeyEvent('Enter'); | 641 this.sendKeyEvent('Enter'); |
643 this.sendKeyEvent('ArrowUp'); | 642 this.sendKeyEvent('ArrowUp'); |
644 assertEqualsJSON([{keyCode: 13, keyName: 'Enter', charValue: 0x0A}, | 643 assertEqualsJSON([{keyCode: 13, keyName: 'Enter', charValue: 0x0A}, |
645 {keyCode: 38, keyName: 'ArrowUp', charValue: 0x41}], | 644 {keyCode: 38, keyName: 'ArrowUp', charValue: 0x41}], |
646 this.keyEvents); | 645 this.keyEvents); |
647 }); | 646 }); |
OLD | NEW |