OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /** | 7 /** |
8 * Verifies that the layout matches with expectations. | 8 * Verifies that the layout matches with expectations. |
9 * @param {Array.<string>} rows List of strings where each string indicates the | 9 * @param {Array<string>} rows List of strings where each string indicates the |
10 * expected sequence of characters on the corresponding row. | 10 * expected sequence of characters on the corresponding row. |
11 */ | 11 */ |
12 function verifyLayout(rows) { | 12 function verifyLayout(rows) { |
13 var rowIndex = 1; | 13 var rowIndex = 1; |
14 rows.forEach(function(sequence) { | 14 rows.forEach(function(sequence) { |
15 var rowId = 'row' + rowIndex++; | 15 var rowId = 'row' + rowIndex++; |
16 var first = sequence[0]; | 16 var first = sequence[0]; |
17 var key = findKey(first, rowId); | 17 var key = findKey(first, rowId); |
18 assertTrue(!!key, 'Unable to find "' + first + '" in "' + rowId + '"'); | 18 assertTrue(!!key, 'Unable to find "' + first + '" in "' + rowId + '"'); |
19 key = getSoftKeyView(key); | 19 key = getSoftKeyView(key); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 name: 'English' | 247 name: 'English' |
248 }; | 248 }; |
249 // Explicitly set up the available input methods. | 249 // Explicitly set up the available input methods. |
250 chrome.inputMethodPrivate.getInputMethods.setCallbackData([ | 250 chrome.inputMethodPrivate.getInputMethods.setCallbackData([ |
251 {id: 'us', name: 'US Keyboard', indicator: 'US'}, | 251 {id: 'us', name: 'US Keyboard', indicator: 'US'}, |
252 {id: 'fr', name: 'French Keyboard', indicator: 'Fr'}, | 252 {id: 'fr', name: 'French Keyboard', indicator: 'Fr'}, |
253 {id: 'de', name: 'German Keyboard', indicator: 'De'} | 253 {id: 'de', name: 'German Keyboard', indicator: 'De'} |
254 ]); | 254 ]); |
255 onKeyboardReady(testCallback, config); | 255 onKeyboardReady(testCallback, config); |
256 } | 256 } |
OLD | NEW |