| 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('cvox.AbstractBraille'); | 7 goog.require('cvox.AbstractBraille'); |
| 8 goog.require('cvox.AbstractEarcons'); | 8 goog.require('cvox.AbstractEarcons'); |
| 9 goog.require('cvox.ChromeVoxEventWatcher'); | 9 goog.require('cvox.ChromeVoxEventWatcher'); |
| 10 goog.require('cvox.ChromeVoxUserCommands'); | 10 goog.require('cvox.ChromeVoxUserCommands'); |
| 11 goog.require('cvox.LiveRegions'); | 11 goog.require('cvox.LiveRegions'); |
| 12 goog.require('cvox.NavigationManager'); | 12 goog.require('cvox.NavigationManager'); |
| 13 goog.require('cvox.NavigationShifter'); | 13 goog.require('cvox.NavigationShifter'); |
| 14 goog.require('cvox.QueueMode'); |
| 14 goog.require('cvox.TestHost'); | 15 goog.require('cvox.TestHost'); |
| 15 goog.require('cvox.TestMathJax'); | 16 goog.require('cvox.TestMathJax'); |
| 16 goog.require('cvox.TestMsgs'); | 17 goog.require('cvox.TestMsgs'); |
| 17 goog.require('cvox.TestTts'); | 18 goog.require('cvox.TestTts'); |
| 18 | 19 |
| 19 | 20 |
| 20 /** | 21 /** |
| 21 * @fileoverview Testing framework for ChromeVox. | 22 * @fileoverview Testing framework for ChromeVox. |
| 22 * | 23 * |
| 23 */ | 24 */ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 41 | 42 |
| 42 cvox.ChromeVox.braille = new cvox.AbstractBraille(); | 43 cvox.ChromeVox.braille = new cvox.AbstractBraille(); |
| 43 cvox.ChromeVox.braille.write = function(params) {}; | 44 cvox.ChromeVox.braille.write = function(params) {}; |
| 44 | 45 |
| 45 cvox.ChromeVox.msgs = new cvox.TestMsgs(); | 46 cvox.ChromeVox.msgs = new cvox.TestMsgs(); |
| 46 | 47 |
| 47 cvox.ChromeVox.host = new cvox.TestHost(); | 48 cvox.ChromeVox.host = new cvox.TestHost(); |
| 48 | 49 |
| 49 // 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 |
| 50 // things is spoken is skipped. | 51 // things is spoken is skipped. |
| 51 cvox.LiveRegions.init(new Date(0), cvox.AbstractTts.QUEUE_MODE_QUEUE, false); | 52 cvox.LiveRegions.init(new Date(0), cvox.QueueMode.QUEUE, false); |
| 52 | 53 |
| 53 cvox.ChromeVoxEventWatcher.init(doc); | 54 cvox.ChromeVoxEventWatcher.init(doc); |
| 54 window.console.log('done setup'); | 55 window.console.log('done setup'); |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 /** | 58 /** |
| 58 * Tears down cvox.ChromeVoxTester. | 59 * Tears down cvox.ChromeVoxTester. |
| 59 * @param {!Document} doc The DOM document where event listeners were added. | 60 * @param {!Document} doc The DOM document where event listeners were added. |
| 60 */ | 61 */ |
| 61 cvox.ChromeVoxTester.tearDown = function(doc) { | 62 cvox.ChromeVoxTester.tearDown = function(doc) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 cvox.ChromeVox.navigationManager.ensureNotSubnavigating(); | 109 cvox.ChromeVox.navigationManager.ensureNotSubnavigating(); |
| 109 cvox.ChromeVox.navigationManager.setGranularity( | 110 cvox.ChromeVox.navigationManager.setGranularity( |
| 110 cvox.ChromeVoxTester.STRATEGY_MAP[strategy]); | 111 cvox.ChromeVoxTester.STRATEGY_MAP[strategy]); |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 /** | 114 /** |
| 114 * Starts reading the page from the current node. | 115 * Starts reading the page from the current node. |
| 115 */ | 116 */ |
| 116 cvox.ChromeVoxTester.readFromHere = function() { | 117 cvox.ChromeVoxTester.readFromHere = function() { |
| 117 cvox.ChromeVox.navigationManager.startReading( | 118 cvox.ChromeVox.navigationManager.startReading( |
| 118 cvox.AbstractTts.QUEUE_MODE_FLUSH); | 119 cvox.QueueMode.FLUSH); |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 /** | 122 /** |
| 122 * Syncs to the given node in the test HTML | 123 * Syncs to the given node in the test HTML |
| 123 * @param {Node} node The node to sync to. | 124 * @param {Node} node The node to sync to. |
| 124 */ | 125 */ |
| 125 cvox.ChromeVoxTester.syncToNode = function(node) { | 126 cvox.ChromeVoxTester.syncToNode = function(node) { |
| 126 cvox.ChromeVox.navigationManager | 127 cvox.ChromeVox.navigationManager |
| 127 .updateSel(cvox.CursorSelection.fromNode(node)); | 128 .updateSel(cvox.CursorSelection.fromNode(node)); |
| 128 cvox.ChromeVox.navigationManager.sync(); | 129 cvox.ChromeVox.navigationManager.sync(); |
| 129 }; | 130 }; |
| 130 | 131 |
| 131 /** | 132 /** |
| 132 * Syncs to the first node in the test. | 133 * Syncs to the first node in the test. |
| 133 */ | 134 */ |
| 134 cvox.ChromeVoxTester.syncToFirstNode = function() { | 135 cvox.ChromeVoxTester.syncToFirstNode = function() { |
| 135 cvox.ChromeVox.navigationManager.updateSel(cvox.CursorSelection.fromBody()); | 136 cvox.ChromeVox.navigationManager.updateSel(cvox.CursorSelection.fromBody()); |
| 136 cvox.ChromeVox.navigationManager.sync(); | 137 cvox.ChromeVox.navigationManager.sync(); |
| 137 }; | 138 }; |
| OLD | NEW |