Chromium Code Reviews| 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. TODO(rsadam@): Only test this for the full layout. | |
|
bshe
2014/04/28 19:40:11
nit: move to TODO to next line
| |
| 25 var caps = document.querySelector('#' + CAPSLOCK_ID); | |
| 26 generateTouchEvent(caps, 'touchstart', true, true); | |
| 27 generateTouchEvent(caps, 'touchend', true, true); | |
| 28 mockTouchType('A'); | |
| 29 // Should persist upper case. | |
| 30 mockTouchType('P'); | |
| 31 mockTouchType('C'); | |
| 32 // Back to lower case. | |
| 33 generateTouchEvent(caps, 'touchstart', true, true); | |
| 34 generateTouchEvent(caps, 'touchend', true, true); | |
| 35 mockTouchType('p'); | |
| 36 // Persist lower case. | |
| 37 mockTouchType('c') | |
| 38 mockTouchType('d') | |
| 39 | |
| 40 // Same test, but using mouse events. | |
| 41 // Start in lower case. | |
| 42 mockMouseType('l'); | |
| 43 // To upper case. | |
| 44 mockMouseTypeOnKey(caps); | |
| 45 mockMouseType('A'); | |
| 46 // Should persist upper case. | |
| 47 mockMouseType('P'); | |
| 48 mockMouseType('C'); | |
| 49 // Back to lower case. | |
| 50 mockMouseTypeOnKey(caps); | |
| 51 mockMouseType('p'); | |
| 52 // Persist lower case. | |
| 53 mockMouseType('c') | |
| 54 mockMouseType('d') | |
| 55 } | |
| OLD | NEW |