Index: chrome/test/data/chromeos/virtual_keyboard/inputview/keyset_transition_test.js |
diff --git a/chrome/test/data/chromeos/virtual_keyboard/inputview/keyset_transition_test.js b/chrome/test/data/chromeos/virtual_keyboard/inputview/keyset_transition_test.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..79cd975c070d0dc8fe86d2eb28ef7faed400af5a |
--- /dev/null |
+++ b/chrome/test/data/chromeos/virtual_keyboard/inputview/keyset_transition_test.js |
@@ -0,0 +1,56 @@ |
+/* |
+ * Copyright 2014 The Chromium Authors. All rights reserved. |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+function testShiftHighlight() { |
+ // Start in lower case. |
+ mockTouchType('l'); |
+ var shift = getShiftKey(Alignment.LEFT); |
+ generateTouchEvent(shift, 'touchstart', true, true); |
+ generateTouchEvent(shift, 'touchend', true, true); |
+ // Transitioned to upper case. |
+ mockTouchType('A'); |
+ // Should revert to lower case. |
+ mockTouchType('p'); |
+ // Should remain in lower case. |
+ mockTouchType('c'); |
+} |
+ |
+function testCapslock() { |
+ // Start in lower case. |
+ mockTouchType('l'); |
+ // To upper case. |
+ // TODO(rsadam@): Only test this for the full layout. |
+ var caps = document.querySelector('#' + CAPSLOCK_ID); |
+ generateTouchEvent(caps, 'touchstart', true, true); |
+ generateTouchEvent(caps, 'touchend', true, true); |
+ mockTouchType('A'); |
+ // Should persist upper case. |
+ mockTouchType('P'); |
+ mockTouchType('C'); |
+ // Back to lower case. |
+ generateTouchEvent(caps, 'touchstart', true, true); |
+ generateTouchEvent(caps, 'touchend', true, true); |
+ mockTouchType('p'); |
+ // Persist lower case. |
+ mockTouchType('c') |
+ mockTouchType('d') |
+ |
+ // Same test, but using mouse events. |
+ // Start in lower case. |
+ mockMouseType('l'); |
+ // To upper case. |
+ mockMouseTypeOnKey(caps); |
+ mockMouseType('A'); |
+ // Should persist upper case. |
+ mockMouseType('P'); |
+ mockMouseType('C'); |
+ // Back to lower case. |
+ mockMouseTypeOnKey(caps); |
+ mockMouseType('p'); |
+ // Persist lower case. |
+ mockMouseType('c') |
+ mockMouseType('d') |
+} |