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 goog.provide('cvox.ChromeVoxTester'); | 5 goog.provide('cvox.ChromeVoxTester'); |
6 | 6 |
| 7 goog.require('TestMsgs'); |
7 goog.require('cvox.AbstractEarcons'); | 8 goog.require('cvox.AbstractEarcons'); |
8 goog.require('cvox.BrailleInterface'); | 9 goog.require('cvox.BrailleInterface'); |
9 goog.require('cvox.ChromeVoxEventWatcher'); | 10 goog.require('cvox.ChromeVoxEventWatcher'); |
10 goog.require('cvox.ChromeVoxUserCommands'); | 11 goog.require('cvox.ChromeVoxUserCommands'); |
11 goog.require('cvox.LiveRegions'); | 12 goog.require('cvox.LiveRegions'); |
12 goog.require('cvox.NavigationManager'); | 13 goog.require('cvox.NavigationManager'); |
13 goog.require('cvox.NavigationShifter'); | 14 goog.require('cvox.NavigationShifter'); |
14 goog.require('cvox.QueueMode'); | 15 goog.require('cvox.QueueMode'); |
15 goog.require('cvox.TestHost'); | 16 goog.require('cvox.TestHost'); |
16 goog.require('cvox.TestMathJax'); | 17 goog.require('cvox.TestMathJax'); |
17 goog.require('cvox.TestMsgs'); | |
18 goog.require('cvox.TestTts'); | 18 goog.require('cvox.TestTts'); |
19 | 19 |
20 | 20 |
21 /** | 21 /** |
22 * @fileoverview Testing framework for ChromeVox. | 22 * @fileoverview Testing framework for ChromeVox. |
23 * | 23 * |
24 */ | 24 */ |
25 | 25 |
26 | 26 |
27 /** | 27 /** |
28 * Initializes cvox.ChromeVoxTester and sets up the mock ChromeVox | 28 * Initializes cvox.ChromeVoxTester and sets up the mock ChromeVox |
29 * environment. | 29 * environment. |
30 * @param {!Document} doc The DOM document to add event listeners to. | 30 * @param {!Document} doc The DOM document to add event listeners to. |
31 */ | 31 */ |
32 cvox.ChromeVoxTester.setUp = function(doc) { | 32 cvox.ChromeVoxTester.setUp = function(doc) { |
33 cvox.ChromeVox.mathJax = new cvox.TestMathJax(); | 33 cvox.ChromeVox.mathJax = new cvox.TestMathJax(); |
34 | 34 |
35 cvox.ChromeVox.navigationManager = new cvox.NavigationManager(); | 35 cvox.ChromeVox.navigationManager = new cvox.NavigationManager(); |
36 cvox.ChromeVoxTester.testTts_ = new cvox.TestTts(); | 36 cvox.ChromeVoxTester.testTts_ = new cvox.TestTts(); |
37 cvox.ChromeVox.tts = cvox.ChromeVoxTester.testTts_; | 37 cvox.ChromeVox.tts = cvox.ChromeVoxTester.testTts_; |
38 | 38 |
39 // TODO(deboer): Factor this out as 'TestEarcons' | 39 // TODO(deboer): Factor this out as 'TestEarcons' |
40 cvox.ChromeVox.earcons = new cvox.AbstractEarcons(); | 40 cvox.ChromeVox.earcons = new cvox.AbstractEarcons(); |
41 cvox.ChromeVox.earcons.playEarcon = function(earcon) { }; | 41 cvox.ChromeVox.earcons.playEarcon = function(earcon) { }; |
42 | 42 |
43 cvox.ChromeVox.braille = new cvox.BrailleInterface(); | 43 cvox.ChromeVox.braille = new cvox.BrailleInterface(); |
44 cvox.ChromeVox.braille.write = function(params) {}; | 44 cvox.ChromeVox.braille.write = function(params) {}; |
45 | 45 |
46 cvox.ChromeVox.msgs = new cvox.TestMsgs(); | 46 Msgs = TestMsgs; |
47 | 47 |
48 cvox.ChromeVox.host = new cvox.TestHost(); | 48 cvox.ChromeVox.host = new cvox.TestHost(); |
49 | 49 |
50 // Init LiveRegions with a date of 0 so that the initial delay before | 50 // Init LiveRegions with a date of 0 so that the initial delay before |
51 // things is spoken is skipped. | 51 // things is spoken is skipped. |
52 cvox.LiveRegions.init(new Date(0), cvox.QueueMode.QUEUE, false); | 52 cvox.LiveRegions.init(new Date(0), cvox.QueueMode.QUEUE, false); |
53 | 53 |
54 cvox.ChromeVoxEventWatcher.init(doc); | 54 cvox.ChromeVoxEventWatcher.init(doc); |
55 window.console.log('done setup'); | 55 window.console.log('done setup'); |
56 }; | 56 }; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 cvox.ChromeVox.navigationManager.sync(); | 129 cvox.ChromeVox.navigationManager.sync(); |
130 }; | 130 }; |
131 | 131 |
132 /** | 132 /** |
133 * Syncs to the first node in the test. | 133 * Syncs to the first node in the test. |
134 */ | 134 */ |
135 cvox.ChromeVoxTester.syncToFirstNode = function() { | 135 cvox.ChromeVoxTester.syncToFirstNode = function() { |
136 cvox.ChromeVox.navigationManager.updateSel(cvox.CursorSelection.fromBody()); | 136 cvox.ChromeVox.navigationManager.updateSel(cvox.CursorSelection.fromBody()); |
137 cvox.ChromeVox.navigationManager.sync(); | 137 cvox.ChromeVox.navigationManager.sync(); |
138 }; | 138 }; |
OLD | NEW |