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.
7 function testShiftHighlightAsync(testDoneCallback
) {
8 var test = function() {
9 // Start in lower case.
11 var shift
= getKey("leftShift");
12 generateTouchEvent(shift
, 'touchstart', true, true);
13 generateTouchEvent(shift
, 'touchend', true, true);
14 // Transitioned to upper case.
16 // Should revert to lower case.
18 // Should remain in lower case.
21 RunTest(test
, testDoneCallback
);
24 function testCapslockAsync(testDoneCallback
) {
25 // Skip this test for compact layouts since they don't have capslock keys.
26 var id
= getLayoutId();
27 if (id
.indexOf("compact") > 0) {
28 testDoneCallback(false);
31 var test = function() {
32 // Start in lower case.
35 // TODO(rsadam@): Only test this for the full layout.
36 var caps
= getKey("capslock")
37 generateTouchEvent(caps
, 'touchstart', true, true);
38 generateTouchEvent(caps
, 'touchend', true, true);
40 // Should persist upper case.
43 // Back to lower case.
44 generateTouchEvent(caps
, 'touchstart', true, true);
45 generateTouchEvent(caps
, 'touchend', true, true);
47 // Persist lower case.
51 // Same test, but using mouse events.
52 // Start in lower case.
55 mockMouseTypeOnKey(caps
);
57 // Should persist upper case.
60 // Back to lower case.
61 mockMouseTypeOnKey(caps
);
63 // Persist lower case.
67 RunTest(test
, testDoneCallback
);