summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsadam@chromium.org <rsadam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-25 18:51:23 +0000
committerrsadam@chromium.org <rsadam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-25 18:51:23 +0000
commit0f19f78d719fba3ae0631970c8b2f5daa1014b87 (patch)
treef3a241e4f0972c29de0fc051acfd47d5563296ac
parent8061352322a3b6d9cccb2add88a09b615cdfe115 (diff)
downloadchromium_src-0f19f78d719fba3ae0631970c8b2f5daa1014b87.zip
chromium_src-0f19f78d719fba3ae0631970c8b2f5daa1014b87.tar.gz
chromium_src-0f19f78d719fba3ae0631970c8b2f5daa1014b87.tar.bz2
Treat newline as white space + add unit test.
BUG=356151 Review URL: https://codereview.chromium.org/211143002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259273 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/test/data/chromeos/virtual_keyboard/keyset_transition_test.js6
-rw-r--r--ui/keyboard/resources/elements/kb-keyboard.js2
2 files changed, 7 insertions, 1 deletions
diff --git a/chrome/test/data/chromeos/virtual_keyboard/keyset_transition_test.js b/chrome/test/data/chromeos/virtual_keyboard/keyset_transition_test.js
index 33214ca..e1761de 100644
--- a/chrome/test/data/chromeos/virtual_keyboard/keyset_transition_test.js
+++ b/chrome/test/data/chromeos/virtual_keyboard/keyset_transition_test.js
@@ -273,5 +273,11 @@ function testUpperOnSpaceAfterPunctuation(testDoneCallback) {
tester.typeKey('a', 0x41, Modifier.NONE, Keyset.LOWER);
tester.typeKey(' ', 0x20, Modifier.NONE, Keyset.LOWER);
tester.typeKey('a', 0x41, Modifier.NONE, Keyset.LOWER);
+ // Test the newline also causes a transition to upper.
+ tester.typeKey('a', 0x41, Modifier.NONE, Keyset.LOWER);
+ tester.typeKey('.', 0xBE, Modifier.NONE, Keyset.LOWER);
+ tester.typeKey('\n', 0x0D, Modifier.NONE, Keyset.LOWER);
+ tester.typeKey('A', 0x41, Modifier.SHIFT, Keyset.UPPER);
+ tester.typeKey('a', 0x41, Modifier.NONE, Keyset.LOWER);
tester.scheduleTest('testUpperOnSpaceAfterPunctuation', testDoneCallback);
}
diff --git a/ui/keyboard/resources/elements/kb-keyboard.js b/ui/keyboard/resources/elements/kb-keyboard.js
index 701be78..23c49e5 100644
--- a/ui/keyboard/resources/elements/kb-keyboard.js
+++ b/ui/keyboard/resources/elements/kb-keyboard.js
@@ -713,6 +713,7 @@ Polymer('kb-keyboard', {
insertText(char);
// Post-typing logic.
switch(char) {
+ case '\n':
case ' ':
if(enterUpperOnSpace) {
enterUpperOnSpace = false;
@@ -727,7 +728,6 @@ Polymer('kb-keyboard', {
// Immediately return to maintain shift-state. Space is a
// non-control key and would otherwise trigger a reset of the
// shift key, causing a transition to lower case.
- // TODO(rsadam): Add unit test after Polymer uprev complete.
return;
}
break;