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 /** | 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 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 assertEqualsJSON(expected, as_array); | 37 assertEqualsJSON(expected, as_array); |
38 } | 38 } |
39 | 39 |
40 TEST_F('CvoxLibLouisTest', 'checkAllTables', function() { | 40 TEST_F('CvoxLibLouisTest', 'checkAllTables', function() { |
41 cvox.BrailleTable.getAll(function(all_tables) { | 41 cvox.BrailleTable.getAll(function(all_tables) { |
42 var i = 0; | 42 var i = 0; |
43 var checkNextTable = function() { | 43 var checkNextTable = function() { |
44 var table = all_tables[i++]; | 44 var table = all_tables[i++]; |
45 if (table) { | 45 if (table) { |
46 this.instance.getTranslator(table.fileName, function(translator) { | 46 this.instance.getTranslator(table.fileNames, function(translator) { |
47 assertNotEquals(null, translator, | 47 assertNotEquals(null, translator, |
48 'Table ' + table + ' should be valid'); | 48 'Table ' + table + ' should be valid'); |
49 checkNextTable(); | 49 checkNextTable(); |
50 }); | 50 }); |
51 } else { | 51 } else { |
52 testDone(); | 52 testDone(); |
53 } | 53 } |
54 }.bind(this); | 54 }.bind(this); |
55 checkNextTable(); | 55 checkNextTable(); |
56 }.bind(this)); | 56 }.bind(this)); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 }); | 121 }); |
122 this.instance.attachToElement(document.body); | 122 this.instance.attachToElement(document.body); |
123 }); | 123 }); |
124 | 124 |
125 TEST_F('CvoxLibLouisTest', 'testGetInvalidTranslator', function() { | 125 TEST_F('CvoxLibLouisTest', 'testGetInvalidTranslator', function() { |
126 this.instance.getTranslator('nonexistant-table', function(translator) { | 126 this.instance.getTranslator('nonexistant-table', function(translator) { |
127 assertEquals(null, translator); | 127 assertEquals(null, translator); |
128 testDone(); | 128 testDone(); |
129 }); | 129 }); |
130 }); | 130 }); |
OLD | NEW |