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 |
22 // Start in lower case. | 27 // Start in lower case. |
23 mockTouchType('l'); | 28 mockTouchType('l'); |
24 // To upper case. | 29 // To upper case. |
25 // TODO(rsadam@): Only test this for the full layout. | 30 // TODO(rsadam@): Only test this for the full layout. |
26 var caps = document.querySelector('#' + CAPSLOCK_ID); | 31 var caps = getKey("capslock") |
27 generateTouchEvent(caps, 'touchstart', true, true); | 32 generateTouchEvent(caps, 'touchstart', true, true); |
28 generateTouchEvent(caps, 'touchend', true, true); | 33 generateTouchEvent(caps, 'touchend', true, true); |
29 mockTouchType('A'); | 34 mockTouchType('A'); |
30 // Should persist upper case. | 35 // Should persist upper case. |
31 mockTouchType('P'); | 36 mockTouchType('P'); |
32 mockTouchType('C'); | 37 mockTouchType('C'); |
33 // Back to lower case. | 38 // Back to lower case. |
34 generateTouchEvent(caps, 'touchstart', true, true); | 39 generateTouchEvent(caps, 'touchstart', true, true); |
35 generateTouchEvent(caps, 'touchend', true, true); | 40 generateTouchEvent(caps, 'touchend', true, true); |
36 mockTouchType('p'); | 41 mockTouchType('p'); |
(...skipping 10 matching lines...) Expand all Loading... |
47 // Should persist upper case. | 52 // Should persist upper case. |
48 mockMouseType('P'); | 53 mockMouseType('P'); |
49 mockMouseType('C'); | 54 mockMouseType('C'); |
50 // Back to lower case. | 55 // Back to lower case. |
51 mockMouseTypeOnKey(caps); | 56 mockMouseTypeOnKey(caps); |
52 mockMouseType('p'); | 57 mockMouseType('p'); |
53 // Persist lower case. | 58 // Persist lower case. |
54 mockMouseType('c') | 59 mockMouseType('c') |
55 mockMouseType('d') | 60 mockMouseType('d') |
56 } | 61 } |
OLD | NEW |