Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager.js

Issue 927313002: Fix and reenable liblouis chromevox tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test_api
Patch Set: Fix BrailleTranslatorManager tests that broke when fetchTables was moved into the event handler. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager_test.extjs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** 5 /**
6 * @fileoverview Keeps track of the current braille translators. 6 * @fileoverview Keeps track of the current braille translators.
7 */ 7 */
8 8
9 goog.provide('cvox.BrailleTranslatorManager'); 9 goog.provide('cvox.BrailleTranslatorManager');
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 * @type {cvox.LibLouis.Translator} 54 * @type {cvox.LibLouis.Translator}
55 * @private 55 * @private
56 */ 56 */
57 this.uncontractedTranslator_ = null; 57 this.uncontractedTranslator_ = null;
58 /** 58 /**
59 * @type {string?} 59 * @type {string?}
60 * @private 60 * @private
61 */ 61 */
62 this.uncontractedTableId_ = null; 62 this.uncontractedTableId_ = null;
63 63
64 this.fetchTables_(); 64 if (!opt_liblouisForTest) {
65 document.addEventListener('DOMContentLoaded', this.loadLiblouis_.bind(this), 65 document.addEventListener('DOMContentLoaded',
66 false); 66 this.loadLiblouis_.bind(this),
67 false);
68 }
67 }; 69 };
68 70
69 cvox.BrailleTranslatorManager.prototype = { 71 cvox.BrailleTranslatorManager.prototype = {
70 /** 72 /**
71 * Adds a listener to be called whenever there is a change in the 73 * Adds a listener to be called whenever there is a change in the
72 * translator(s) returned by other methods of this instance. 74 * translator(s) returned by other methods of this instance.
73 * @param {function()} listener The listener. 75 * @param {function()} listener The listener.
74 */ 76 */
75 addChangeListener: function(listener) { 77 addChangeListener: function(listener) {
76 this.changeListeners_.push(listener); 78 this.changeListeners_.push(listener);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 206
205 /** 207 /**
206 * Loads the liblouis instance by attaching it to the document. 208 * Loads the liblouis instance by attaching it to the document.
207 * @private 209 * @private
208 */ 210 */
209 loadLiblouis_: function() { 211 loadLiblouis_: function() {
210 // Cast away nullability. When the document is loaded, it will always 212 // Cast away nullability. When the document is loaded, it will always
211 // have a body. 213 // have a body.
212 this.liblouis_.attachToElement( 214 this.liblouis_.attachToElement(
213 /** @type {!HTMLBodyElement} */ (document.body)); 215 /** @type {!HTMLBodyElement} */ (document.body));
216 this.fetchTables_();
214 }, 217 },
215 218
216 /** 219 /**
217 * @return {!cvox.LibLouis} The liblouis instance used by this object. 220 * @return {!cvox.LibLouis} The liblouis instance used by this object.
218 */ 221 */
219 getLibLouisForTest: function() { 222 getLibLouisForTest: function() {
220 return this.liblouis_; 223 return this.liblouis_;
221 }, 224 },
222 225
223 /** 226 /**
224 * @return {!Array<cvox.BrailleTable.Table>} The currently loaded braille 227 * @return {!Array<cvox.BrailleTable.Table>} The currently loaded braille
225 * tables, or an empty array if they are not yet loaded. 228 * tables, or an empty array if they are not yet loaded.
226 */ 229 */
227 getTablesForTest: function() { 230 getTablesForTest: function() {
228 return this.tables_; 231 return this.tables_;
229 } 232 }
230 }; 233 };
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/braille/braille_translator_manager_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698