OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 The Chromium Authors. All rights reserved. | 2 * Copyright 2013 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 * Returns the unique transition key identified by the innerText, | 8 * Returns the unique transition key identified by the innerText, |
9 * alignment and keyset it is in. | 9 * alignment and keyset it is in. |
10 * @param {string} alignment The alignment of the key. One of {left,right}. | 10 * @param {string} alignment The alignment of the key. One of {left,right}. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 mockTimer.tick(1000); | 181 mockTimer.tick(1000); |
182 upperShift.up(mockEvent); | 182 upperShift.up(mockEvent); |
183 assertEquals('qwerty-upper', keyboard.activeKeysetId, | 183 assertEquals('qwerty-upper', keyboard.activeKeysetId, |
184 "Unexpected transition on long press."); | 184 "Unexpected transition on long press."); |
185 keyboard.inputTypeValue = 'text'; | 185 keyboard.inputTypeValue = 'text'; |
186 } | 186 } |
187 | 187 |
188 var subtasks = []; | 188 var subtasks = []; |
189 subtasks.push(transition('qwerty-lower', 'number', | 189 subtasks.push(transition('qwerty-lower', 'number', |
190 "Did not reset keyboard on focus change")); | 190 "Did not reset keyboard on focus change")); |
191 subtasks.push(transition('numeric-symbol', 'password', | 191 subtasks.push(transition('numeric-symbol', 'text', |
192 "Did not switch to numeric keypad.")); | |
193 subtasks.push(transition('system-qwerty-lower', 'text', | |
194 "Did not switch to numeric keypad.")); | 192 "Did not switch to numeric keypad.")); |
195 // Clean up | 193 // Clean up |
196 subtasks.push(function() { | 194 subtasks.push(function() { |
197 assertEquals('qwerty-lower', keyboard.activeKeysetId, | 195 assertEquals('qwerty-lower', keyboard.activeKeysetId, |
198 "Unexpected final active keyset"); | 196 "Unexpected final active keyset"); |
199 }); | 197 }); |
200 onKeyboardReady(testName, setupWork, testDoneCallback, subtasks); | 198 onKeyboardReady(testName, setupWork, testDoneCallback, subtasks); |
201 } | 199 } |
202 | 200 |
203 /** | 201 /** |
204 * Tests that keyset transitions work as expected. | 202 * Tests that keyset transitions work as expected. |
205 * The test is run asynchronously since the keyboard loads keysets dynamically. | 203 * The test is run asynchronously since the keyboard loads keysets dynamically. |
206 * @param {function} testDoneCallback The function to be called on completion. | 204 * @param {function} testDoneCallback The function to be called on completion. |
207 */ | 205 */ |
208 function testKeysetTransitionsAsync(testDoneCallback) { | 206 function testKeysetTransitionsAsync(testDoneCallback) { |
209 var runTest = function() { | 207 var runTest = function() { |
210 var alignments = ['left', 'right']; | 208 var alignments = ['left', 'right']; |
211 for (var i in alignments) { | 209 for (var i in alignments) { |
212 checkBasicTransitions(alignments[i]); | 210 checkBasicTransitions(alignments[i]); |
213 } | 211 } |
214 }; | 212 }; |
215 onKeyboardReady('testKeysetTransitionsAsync', | 213 onKeyboardReady('testKeysetTransitionsAsync', |
216 runTest, testDoneCallback); | 214 runTest, testDoneCallback); |
217 } | 215 } |
OLD | NEW |