Commit Graph

66 Commits (2811592934a51d78e726a27de45c9d20826dfea4)

Author SHA1 Message Date
Tadashi G. Takaoka 5f00fe09e9 Fix some compiler warnings
This CL fixes the following compiler warnings.

- Indirect access to static member
- Access to a non-accessible member of an enclosing type
- Parameter assignment
- Method can be static
- Local variable declaration hides another field or variable
- Value of local variable is not used
- Unused import
- Unused private member
- Unnecessary 'else' statement
- Unnecessary declaration of throw exception
- Redundant type arguments
- Missing '@Override' annotation
- Unused '@SuppressWarning' annotations

Bug: 18003991
Change-Id: Icfebe753e53a2cc621848f769d6a3d7ce501ebc7
2014-10-21 19:28:37 +09:00
Jean Chalard 9ddbee8570 Add the first gesture unit tests.
At last I found a simple way to do it !

Bug: 8845843
Change-Id: I4dd3bf987b58e29a44cf0d7389d294657a33abe1
2014-10-15 19:04:06 +09:00
Jean Chalard 81a5a10476 [ML19] Actually switch the language when appropriate
That is, when auto-correcting or when manually picking.
This is not great, but it's a good starting point.

Bug: 11230254
Change-Id: I07627f48e2de1c28053d6572c7c72625808ec79c
2014-10-09 13:13:25 +09:00
Jean Chalard 161080c029 Fix tests.
Looper.prepare() is not called automatically for us any more.

Bug: 17518123
Change-Id: I2fb6caa4ef79ce7ed86ff58518f4b000483e508f
2014-09-17 19:12:04 +09:00
Jean Chalard 908f0ed154 Introduce onEvent() to improve testability
...and prepare for the future

Change-Id: Ieed96ab552993fd148e80b9c3355f1b569bd716f
2014-08-25 16:33:47 +09:00
Ken Wakasa f5f5fb4b64 Revert "Introduce onEvent() to improve testability"
This reverts commit ef74e737f5.

Apparently, this CL broke several unit tests.

Change-Id: I86cf5f1ffb0214707afe99ee97f92ba8c5157f3f
2014-08-06 23:57:03 +00:00
Jean Chalard ef74e737f5 Introduce onEvent() to improve testability
...and prepare for the future

Change-Id: Ieed96ab552993fd148e80b9c3355f1b569bd716f
2014-08-06 07:29:35 +00:00
Jean Chalard 3fb5a541a4 Fix tests
Change-Id: I12ba56d021b50c03dc62e3f3c8db3ecada2f6a4b
2014-06-30 15:25:31 +09:00
Jean Chalard d0d3d813d2 Fix tests
DEBUG in LatinIME has been changed by Ie52007dc to mean both
DebugSettings.PREF_DEBUG_MODE and Settings.PREF_KEY_IS_INTERNAL
instead of just DEBUG_MODE as used to be the case. Tests depend
on the debug mode to test many things and they make sure they run
in debug mode or they fail. This has tests understand the change in
policy.

Change-Id: Ie9f29e6a1d85e19704c8940d3fcf97c13c3dbaa6
2014-05-29 22:15:56 +09:00
Jean Chalard 68730d1c8e Fix unit tests.
Language change has always been strange. That's because we
didn't call the right method >.>
Also, extra values were not passed in correctly.

Change-Id: Ifc345988df944ad691fe22cb71cb519e47a5a223
2014-05-14 16:09:40 +09:00
Jean Chalard 2282e8520a Fix updating the shift state upon backspace
Bug: 13514349
Change-Id: If4c9db12b0ab5be676f7a2f72715f469066ee537
2014-04-14 21:28:24 +09:00
Jean Chalard 4370ff0998 Fix some flaky tests.
In tests, we create many instances of LatinIME, but we never
destroy them. That means we never close the dictionaries nor
the handlers.
This change calls onDestroy, which closes all dictionaries, and
adds some code to finish the handlers.

Change-Id: I942517a2a940c54256b08763f6b38f5b55809f55
2014-04-10 17:32:05 +09:00
Jean Chalard 28a59dd049 Fix a bug with double-space-to-period
Bug: 13778001
Change-Id: I3ebd57950cdfacbbcdc64ed214c0590519a0665c
2014-04-03 22:07:57 +09:00
Keisuke Kuroyanagi d36328cecf Add test only methods to test personalized dicts.
Bug: 11122480
Change-Id: I79a4a73ff09a2d34d4ca094d705e901fb4bc855c
2014-02-20 22:20:43 +09:00
Yohei Yukawa 6d43124215 Stop using deprecated InputMethodSubtype constructor
The constructors of InputMethodSubtype were deprecated in API level 19.
However we cannot yet switch to a new InputMethodSubtypeBuilder style
due to our minimum support API level.

As an intermediate solution, this patch replaces the these API calls
with InputMethodSubtypeCompatUtils.newInputMethodSubtype so that
these legacy API call can be consolidated at the same place.

BUG: 13030512
Change-Id: I561a585f5dbea56c337680b645be5ef07015a0b1
2014-02-17 15:32:33 +09:00
Tadashi G. Takaoka da973e75dc Make InputLogicTest more robust
Change-Id: I134f14971126cbeed05b472c08747f2b88ad30e6
2014-02-13 19:38:51 +09:00
Jean Chalard bac89ecc50 Fix a failing test.
A replay of that old, horribly hard-to-find bug: we post a
resume message during onStartInputView, so we need
to process it before we start the test. But now the message
is posted with a delay, so we need to wait for the delay...

Change-Id: I843d70e636fa51a68aadbdbbaa73b1711ad7bddd
2014-02-12 23:32:51 +09:00
Jean Chalard 7b6e999cd1 Fix a test.
Bug: 12483313
Change-Id: Ia811d614b9260367871bc5717f587538adf46789
2014-01-10 21:39:43 +09:00
Keisuke Kuroyanagi 9f1fe87580 Make reloadMainDict() private.
Bug: 8187060
Change-Id: I852a751d748f39512e62c9cd69748dfbe87b2151
2014-01-08 18:59:43 +09:00
Jean Chalard 1404c1af85 [IL21] Move the workaround utils to a better place.
Bug: 8636060
Change-Id: I566f9e109ebcabe3a6a778118434ce79d02d1113
2013-12-20 16:48:54 +09:00
Ken Wakasa 2fa3693c26 Reset to 9bd6dac470
The bulk merge from -bayo to klp-dev should not have been merged to master.

Change-Id: I527a03a76f5247e4939a672f27c314dc11cbb854
2013-12-13 17:13:32 +09:00
Keisuke Kuroyanagi 72bc9ad37e Add Ime language switching test.
Change-Id: I6a96dc5fdd533899353d537382608c2759faff1c
2013-10-08 14:00:57 +09:00
Jean Chalard 24aad5a4d5 [AC4] Add native methods necessary for auto-commit
Bug: 9059617
Change-Id: I7a47b0675446fc4f39628c60d16de9aea90d1b4d
2013-09-13 20:15:15 +09:00
Yuichiro Hanada e193c5255d Revert Ida230ca42 and I6adf7d08f.
Change-Id: I2ddb250d5a473ea955a5171656974de7288a13f7
2013-09-10 19:08:43 +09:00
Yuichiro Hanada cc2751ba03 Make commitCurrentAutoCorrection asynchronous.
Change-Id: Ida230ca4243347fb3ab9fda7de3a9a18f886cd1c
2013-09-09 14:47:26 +09:00
Jean Chalard e8ef095670 [AC2] Reference a dict rather than a string in suggestion infos
Bug: 9059617
Change-Id: Ic17bc0fd5d812268fd37d7fd35b4e9ebfb95fa5e
2013-08-20 19:18:09 +09:00
Jean Chalard ef1e363016 [AC1] Add a memory of where to cut the first word.
Bug: 9059617
Change-Id: I931b6d1eb49f9f7dd7d5b18956e35751d1b2b631
2013-08-20 18:43:19 +09:00
Jean Chalard c239a34262 Support languages that don't use spaces.
Thai is an example.

Bug: 10138062
Change-Id: Ib9a8264c77ed42b4256432d7c8a60d08575dcdc7
2013-08-16 21:01:08 +09:00
Tadashi G. Takaoka 7dc60f9db7 Add getters and copy constructor to Key class
Change-Id: I78eb96dcc26378926dc63acbfeb4828cbd44435d
2013-08-15 20:12:46 +09:00
Tadashi G. Takaoka e8264cab71 Utilize Keyboard.getKey(codePoint)
Change-Id: Ia4df4dfbf3b6d22f7b93b979bba36e4920af2239
2013-08-13 12:15:03 +09:00
Jean Chalard 5408fec63a Fix an NPE
Also make mSuggest private for more security.

Bug: 10045657
Change-Id: I712505e4d2a2606efff5d09ba9b4c656f9e7c7a9
2013-07-29 18:09:48 +09:00
Ken Wakasa bc1813186d Merge "Move util classes to the latin/utils directory" 2013-06-24 08:49:06 +00:00
Ken Wakasa e28eba5074 Move util classes to the latin/utils directory
Change-Id: I1c5b27c8edf231680edb8d96f63b9d04cfc6a6fa
2013-06-24 17:04:40 +09:00
Jean Chalard a099638667 Fix tests for Ia78d3540
Bug: 9550023
Change-Id: I13f4411573ff7b2564e88fc9b9a8d801dde23019
2013-06-24 15:40:53 +09:00
Jean Chalard c9aaba1253 Don't process recorrection or resets when not shown
Bug: 8954116
Change-Id: Ica27dbfc570643bb81e6cdf34cc7c796ea080d71
2013-05-15 20:20:20 +09:00
Satoshi Kataoka c43417fb5d Fix build
Change-Id: Ib9373b26b04b0f4789b3cd6a7af64e4bcd2c4b9c
2013-05-01 19:01:36 +09:00
Satoshi Kataoka d5781eef62 Fix Google spell checker tests
Bug: 8613307

Change-Id: Ief04a4abb6dc1f79660a2e419c9c5e271802b5a1
2013-05-01 18:21:56 +09:00
Jean Chalard d89ed47616 Remove voodoo magic.
There was a much, much simpler way of achieving the same thing.

Bug: 8583091
Change-Id: I8882f389312caad3b17335672892a31d30cd00bc
2013-04-12 17:05:43 +09:00
Jean Chalard 9310f42a36 Offer to add any OOV typed word to the dictionary.
That includes gestures, which used not to work.

Bug: 8532637
Change-Id: I04606565d7000faadf954c4a806c39d4d162a2c1
2013-04-09 12:05:54 +09:00
Jean Chalard 5d399ec719 Change which backdoor the tests goes through
Yes that's even harder to understand. The old technique doesn't work
any more, so I have to drill a new hole in this class.

Bug: 8303100
Change-Id: I70a41b5094dab2bb56a17eaf55b2a2df853e4bb6
2013-04-02 18:20:19 +09:00
Jean Chalard 84bfde0421 Fix a test.
The test was not passing the correct input type when it was
creating the text view, resulting in mismatched types seen from
TextView and LatinIME with some bad results. The test would
even go as far as restoring it after it's been fixed by TextView.

Additionally, since we want to enter litteral carriage returns,
the input type should be MULTI_LINE. If not, TextView does
not allow carriage returns.

Bug: 8302690
Change-Id: I1c20bcf6ca554ad981048ec181e19c649f6c742e
2013-04-02 18:20:14 +09:00
Tadashi G. Takaoka ce6bcdd1a5 Separate caps mode related utils to CapsModeUtils
Change-Id: I32700c434b296bb3fd39e040c2dda1fe90667daf
2013-02-12 18:15:42 +09:00
Tadashi G. Takaoka b4598f7d05 Add unit tests tags
Bug: 8131968
Change-Id: Ibca5a0d63a492134b8af401a62ca3a5748e003cf
2013-02-04 17:21:30 -08:00
Jean Chalard 01a4ebcd88 Add a way to know externally if we're installing a new dict
That helps tests know when to wait and when to declare the
dictionary actually not usable.

Bug: 7925814
Change-Id: Ic963c1206c43e3cde39ac4214a0d601f4fc6c03b
2013-01-31 09:04:55 +09:00
Jean Chalard 912ad4614f Fix international tests
Tests have been broken again by recent changes to subtype
choice within Latin IME. This fixes the problem and all tests
pass again.

This change also includes a small fix to one test that was
checking for something irrelevant.

Change-Id: I6a03dea24f99b0d2ad84c4161a8413f3060bb811
2013-01-10 15:12:17 +09:00
Tadashi G. Takaoka f483225397 Get rid of current subtype and system locale cache from SubtypeSwitcher
Bug: 7675452
Change-Id: I2121f56964b6d25e8d40f5b8ec67eeae527b2117
2012-12-27 12:00:38 +09:00
Tadashi G. Takaoka bc464e2952 Replace useless CharSequence to String
Change-Id: Idc478f901185ee1b4912acc82d0cbc54fee4e991
2012-10-22 11:03:28 -07:00
Jean Chalard 6ae5e45118 Stop using private APIs in tests.
Not sure it's much better, but at least this is public.

Bug: 6202480
Change-Id: If6cda78fbd32cfb068e0b2fcb637914939b044b3
2012-10-10 20:22:53 +09:00
Jean Chalard 2752287c42 Fix failing tests.
Most of the failures can be ascribed to the tests not passing the correct
old position of the cursor on a second call to onUpdateSelection() to
LatinIME.

Bug: 7276565
Bug: 7276805
Bug: 7276195
Change-Id: I3f1b52cdcc783ea18838408bed50699b7254eaf4
2012-10-10 19:42:29 +09:00
Jean Chalard c61bed6860 Add a preliminary test for basic Russian spell check
Bug: 6981919
Change-Id: I5ec6a6468cb616e7a4369c79b4dbfc84f3d8de59
2012-09-04 17:47:44 +09:00