OLD | NEW |
(Empty) | |
| 1 /* |
| 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 |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 function testShiftHighlight() { |
| 8 // Start in lower case. |
| 9 mockTouchType('l'); |
| 10 var shift = getShiftKey(Alignment.LEFT); |
| 11 generateTouchEvent(shift, 'touchstart', true, true); |
| 12 generateTouchEvent(shift, 'touchend', true, true); |
| 13 // Transitioned to upper case. |
| 14 mockTouchType('A'); |
| 15 // Should revert to lower case. |
| 16 mockTouchType('p'); |
| 17 // Should remain in lower case. |
| 18 mockTouchType('c'); |
| 19 } |
| 20 |
| 21 function testCapslock() { |
| 22 // Start in lower case. |
| 23 mockTouchType('l'); |
| 24 // To upper case. |
| 25 // TODO(rsadam@): Only test this for the full layout. |
| 26 var caps = document.querySelector('#' + CAPSLOCK_ID); |
| 27 generateTouchEvent(caps, 'touchstart', true, true); |
| 28 generateTouchEvent(caps, 'touchend', true, true); |
| 29 mockTouchType('A'); |
| 30 // Should persist upper case. |
| 31 mockTouchType('P'); |
| 32 mockTouchType('C'); |
| 33 // Back to lower case. |
| 34 generateTouchEvent(caps, 'touchstart', true, true); |
| 35 generateTouchEvent(caps, 'touchend', true, true); |
| 36 mockTouchType('p'); |
| 37 // Persist lower case. |
| 38 mockTouchType('c') |
| 39 mockTouchType('d') |
| 40 |
| 41 // Same test, but using mouse events. |
| 42 // Start in lower case. |
| 43 mockMouseType('l'); |
| 44 // To upper case. |
| 45 mockMouseTypeOnKey(caps); |
| 46 mockMouseType('A'); |
| 47 // Should persist upper case. |
| 48 mockMouseType('P'); |
| 49 mockMouseType('C'); |
| 50 // Back to lower case. |
| 51 mockMouseTypeOnKey(caps); |
| 52 mockMouseType('p'); |
| 53 // Persist lower case. |
| 54 mockMouseType('c') |
| 55 mockMouseType('d') |
| 56 } |
OLD | NEW |