| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 assertFalse(menu.hidden, | 172 assertFalse(menu.hidden, |
| 173 'Menu should be visible after tapping menu toggle button'); | 173 'Menu should be visible after tapping menu toggle button'); |
| 174 var menuBounds = menu.getBoundingClientRect(); | 174 var menuBounds = menu.getBoundingClientRect(); |
| 175 assertTrue(menuBounds.width > 0 && menuBounds.height > 0, | 175 assertTrue(menuBounds.width > 0 && menuBounds.height > 0, |
| 176 'Expect non-zero menu bounds.'); | 176 'Expect non-zero menu bounds.'); |
| 177 var hwtSelect = menu.querySelector('#handwriting'); | 177 var hwtSelect = menu.querySelector('#handwriting'); |
| 178 assertTrue(!!hwtSelect, 'Handwriting should be available for testing'); | 178 assertTrue(!!hwtSelect, 'Handwriting should be available for testing'); |
| 179 var hwtSelectBounds = hwtSelect.getBoundingClientRect(); | 179 var hwtSelectBounds = hwtSelect.getBoundingClientRect(); |
| 180 assertTrue(hwtSelectBounds.width > 0 && hwtSelectBounds.height > 0, | 180 assertTrue(hwtSelectBounds.width > 0 && hwtSelectBounds.height > 0, |
| 181 'Expect non-zero size for hwt select button.'); | 181 'Expect non-zero size for hwt select button.'); |
| 182 // TODO(fengyuan): bring back this handwriting test once found the cause. | 182 onSwitchToKeyset('hwt', function() { |
| 183 /*onSwitchToKeyset('hwt', function() { | |
| 184 var view = getActiveView(); | 183 var view = getActiveView(); |
| 185 assertEquals('hwt', view.id, 'Handwriting layout is not active.'); | 184 assertEquals('hwt', view.id, 'Handwriting layout is not active.'); |
| 186 var hwtCanvasView = view.querySelector('#canvasView'); | 185 var hwtCanvasView = view.querySelector('#canvasView'); |
| 187 assertTrue(!!hwtCanvasView, 'Unable to find canvas view'); | 186 assertTrue(!!hwtCanvasView, 'Unable to find canvas view'); |
| 188 var candidateView = document.getElementById('candidateView'); | 187 var panelView = document.getElementById('panelView'); |
| 189 assertTrue(!!candidateView, 'Unable to find candidate view'); | 188 assertTrue(!!panelView, 'Unable to find panel view'); |
| 190 var backButton = candidateView.querySelector( | 189 var backButton = panelView.querySelector('#backToKeyboard'); |
| 191 '.inputview-candidate-button'); | 190 assertTrue(!!backButton, 'Unable to find back button.'); |
| 192 assertEquals('HANDWRITING_BACK', backButton.textContent); | |
| 193 onSwitchToKeyset('us.compact.qwerty', function() { | 191 onSwitchToKeyset('us.compact.qwerty', function() { |
| 194 assertEquals('us-compact-qwerty', getActiveView().id, | 192 assertEquals('us-compact-qwerty', getActiveView().id, |
| 195 'compact layout is not active.'); | 193 'compact layout is not active.'); |
| 196 testDoneCallback(); | 194 testDoneCallback(); |
| 197 }); | 195 }); |
| 198 mockTap(backButton); | 196 mockTap(backButton); |
| 199 }); | 197 }); |
| 200 mockTap(hwtSelect);*/ | 198 mockTap(hwtSelect); |
| 201 testDoneCallback(); | |
| 202 }); | 199 }); |
| 203 }; | 200 }; |
| 204 var config = { | 201 var config = { |
| 205 keyset: 'us.compact.qwerty', | 202 keyset: 'us.compact.qwerty', |
| 206 languageCode: 'en', | 203 languageCode: 'en', |
| 207 passwordLayout: 'us', | 204 passwordLayout: 'us', |
| 208 name: 'English', | 205 name: 'English', |
| 209 options: {enableHwtForTesting: true} | 206 options: {enableHwtForTesting: true} |
| 210 }; | 207 }; |
| 211 onKeyboardReady(testCallback, config); | 208 onKeyboardReady(testCallback, config); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 name: 'English' | 246 name: 'English' |
| 250 }; | 247 }; |
| 251 // Explicitly set up the available input methods. | 248 // Explicitly set up the available input methods. |
| 252 chrome.inputMethodPrivate.getInputMethods.setCallbackData([ | 249 chrome.inputMethodPrivate.getInputMethods.setCallbackData([ |
| 253 {id: 'us', name: 'US Keyboard', indicator: 'US'}, | 250 {id: 'us', name: 'US Keyboard', indicator: 'US'}, |
| 254 {id: 'fr', name: 'French Keyboard', indicator: 'Fr'}, | 251 {id: 'fr', name: 'French Keyboard', indicator: 'Fr'}, |
| 255 {id: 'de', name: 'German Keyboard', indicator: 'De'} | 252 {id: 'de', name: 'German Keyboard', indicator: 'De'} |
| 256 ]); | 253 ]); |
| 257 onKeyboardReady(testCallback, config); | 254 onKeyboardReady(testCallback, config); |
| 258 } | 255 } |
| OLD | NEW |