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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/braille/liblouis_test.extjs

Issue 2817313002: Support braille dot or chorded typing conversions to standard keyboard keys (Closed)
Patch Set: Address feedback. Created 3 years, 8 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
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 Tests for the liblouis Native Client wrapper, as seen from 6 * @fileoverview Tests for the liblouis Native Client wrapper, as seen from
7 * the JavaScript interface. 7 * the JavaScript interface.
8 */ 8 */
9 9
10 // Include test fixture. 10 // Include test fixture.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 function(cells, textToBraille, brailleToText) { 159 function(cells, textToBraille, brailleToText) {
160 assertEquals(null, cells); 160 assertEquals(null, cells);
161 assertEquals(null, textToBraille); 161 assertEquals(null, textToBraille);
162 assertEquals(null, brailleToText); 162 assertEquals(null, brailleToText);
163 called = true; 163 called = true;
164 })); 164 }));
165 assertFalse(called); 165 assertFalse(called);
166 liblouis.detach(); 166 liblouis.detach();
167 }); 167 });
168 }); 168 });
169
170 TEST_F('CvoxLibLouisTest', 'testKeyEventStaticData', function() {
171 var liblouis = this.createAndAttachLiblouis();
172 this.withTranslator(liblouis, 'en-us-comp8.ctb', function(translator) {
173 translator.translate('abcdefghijklmnopqrstuvwxyz 0123456789',
174 this.newCallback(
175 function(cells, textToBraille, brailleToText) {
176 // A-Z.
177 var view = new Uint8Array(cells);
178 for (var i = 0; i < 26; i++) {
179 assertEquals(String.fromCharCode(i + 65),
180 cvox.BrailleKeyEvent.brailleDotsToStandardKeyCode[view[i]]);
181 }
182
183 // 0-9.
184 for (var i = 27; i < 37; i++) {
185 assertEquals(String.fromCharCode(i + 21),
186 cvox.BrailleKeyEvent.brailleDotsToStandardKeyCode[view[i]]);
187 }
188 }));
189 });
190 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698