Chromium Code Reviews| 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 function testShiftHighlight() { | 7 function testShiftHighlight() { |
| 8 // Start in lower case. | 8 // Start in lower case. |
| 9 mockTouchType('l'); | 9 mockTouchType('l'); |
| 10 var shift = getShiftKey(Alignment.LEFT); | 10 var shift = getKey("leftShift"); |
| 11 generateTouchEvent(shift, 'touchstart', true, true); | 11 generateTouchEvent(shift, 'touchstart', true, true); |
| 12 generateTouchEvent(shift, 'touchend', true, true); | 12 generateTouchEvent(shift, 'touchend', true, true); |
| 13 // Transitioned to upper case. | 13 // Transitioned to upper case. |
| 14 mockTouchType('A'); | 14 mockTouchType('A'); |
| 15 // Should revert to lower case. | 15 // Should revert to lower case. |
| 16 mockTouchType('p'); | 16 mockTouchType('p'); |
| 17 // Should remain in lower case. | 17 // Should remain in lower case. |
| 18 mockTouchType('c'); | 18 mockTouchType('c'); |
| 19 } | 19 } |
| 20 | 20 |
| 21 function testCapslock() { | 21 function testCapslock() { |
| 22 // Skip this test for compact layouts since they don't have capslock keys. | |
| 23 var id = getLayoutId(); | |
| 24 if (id.indexOf("compact") > 0) | |
| 25 return; | |
| 26 console.error(id); | |
|
bshe
2014/05/12 13:24:27
nit: remove this console error.
rsadam
2014/05/12 20:23:46
Done.
| |
| 27 | |
| 22 // Start in lower case. | 28 // Start in lower case. |
| 23 mockTouchType('l'); | 29 mockTouchType('l'); |
| 24 // To upper case. | 30 // To upper case. |
| 25 // TODO(rsadam@): Only test this for the full layout. | 31 // TODO(rsadam@): Only test this for the full layout. |
| 26 var caps = document.querySelector('#' + CAPSLOCK_ID); | 32 var caps = getKey("capslock") |
| 27 generateTouchEvent(caps, 'touchstart', true, true); | 33 generateTouchEvent(caps, 'touchstart', true, true); |
| 28 generateTouchEvent(caps, 'touchend', true, true); | 34 generateTouchEvent(caps, 'touchend', true, true); |
| 29 mockTouchType('A'); | 35 mockTouchType('A'); |
| 30 // Should persist upper case. | 36 // Should persist upper case. |
| 31 mockTouchType('P'); | 37 mockTouchType('P'); |
| 32 mockTouchType('C'); | 38 mockTouchType('C'); |
| 33 // Back to lower case. | 39 // Back to lower case. |
| 34 generateTouchEvent(caps, 'touchstart', true, true); | 40 generateTouchEvent(caps, 'touchstart', true, true); |
| 35 generateTouchEvent(caps, 'touchend', true, true); | 41 generateTouchEvent(caps, 'touchend', true, true); |
| 36 mockTouchType('p'); | 42 mockTouchType('p'); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 47 // Should persist upper case. | 53 // Should persist upper case. |
| 48 mockMouseType('P'); | 54 mockMouseType('P'); |
| 49 mockMouseType('C'); | 55 mockMouseType('C'); |
| 50 // Back to lower case. | 56 // Back to lower case. |
| 51 mockMouseTypeOnKey(caps); | 57 mockMouseTypeOnKey(caps); |
| 52 mockMouseType('p'); | 58 mockMouseType('p'); |
| 53 // Persist lower case. | 59 // Persist lower case. |
| 54 mockMouseType('c') | 60 mockMouseType('c') |
| 55 mockMouseType('d') | 61 mockMouseType('d') |
| 56 } | 62 } |
| OLD | NEW |