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. |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 onSwitchToKeyset('hwt', function() { | 182 onSwitchToKeyset('hwt', function() { |
183 var view = getActiveView(); | 183 var view = getActiveView(); |
184 assertEquals('hwt', view.id, 'Handwriting layout is not active.'); | 184 assertEquals('hwt', view.id, 'Handwriting layout is not active.'); |
185 var hwtCanvasView = view.querySelector('#canvasView'); | 185 var hwtCanvasView = view.querySelector('#canvasView'); |
186 assertTrue(!!hwtCanvasView, 'Unable to find canvas view'); | 186 assertTrue(!!hwtCanvasView, 'Unable to find canvas view'); |
187 var candidateView = document.getElementById('candidateView'); | 187 var candidateView = document.getElementById('candidateView'); |
188 assertTrue(!!candidateView, 'Unable to find candidate view'); | 188 assertTrue(!!candidateView, 'Unable to find candidate view'); |
189 var backButton = candidateView.querySelector( | 189 var backButton = candidateView.querySelector( |
190 '.inputview-candidate-button'); | 190 '.inputview-candidate-button'); |
191 assertEquals('HANDWRITING_BACK', backButton.textContent); | 191 assertEquals('HANDWRITING_BACK', backButton.textContent); |
| 192 onSwitchToKeyset('us.compact.qwerty', function() { |
| 193 assertEquals('us-compact-qwerty', getActiveView().id, |
| 194 'compact layout is not active.'); |
| 195 testDoneCallback(); |
| 196 }); |
192 mockTap(backButton); | 197 mockTap(backButton); |
193 assertEquals('us-compact-qwerty', getActiveView().id, | |
194 'compact layout is not active.'); | |
195 testDoneCallback(); | |
196 }); | 198 }); |
197 mockTap(hwtSelect); | 199 mockTap(hwtSelect); |
198 }); | 200 }); |
199 }; | 201 }; |
200 var config = { | 202 var config = { |
201 keyset: 'us.compact.qwerty', | 203 keyset: 'us.compact.qwerty', |
202 languageCode: 'en', | 204 languageCode: 'en', |
203 passwordLayout: 'us', | 205 passwordLayout: 'us', |
204 name: 'English', | 206 name: 'English', |
205 options: {enableHwtForTesting: true} | 207 options: {enableHwtForTesting: true} |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 name: 'English' | 247 name: 'English' |
246 }; | 248 }; |
247 // Explicitly set up the available input methods. | 249 // Explicitly set up the available input methods. |
248 chrome.inputMethodPrivate.getInputMethods.setCallbackData([ | 250 chrome.inputMethodPrivate.getInputMethods.setCallbackData([ |
249 {id: 'us', name: 'US Keyboard', indicator: 'US'}, | 251 {id: 'us', name: 'US Keyboard', indicator: 'US'}, |
250 {id: 'fr', name: 'French Keyboard', indicator: 'Fr'}, | 252 {id: 'fr', name: 'French Keyboard', indicator: 'Fr'}, |
251 {id: 'de', name: 'German Keyboard', indicator: 'De'} | 253 {id: 'de', name: 'German Keyboard', indicator: 'De'} |
252 ]); | 254 ]); |
253 onKeyboardReady(testCallback, config); | 255 onKeyboardReady(testCallback, config); |
254 } | 256 } |
OLD | NEW |