summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChieu Nguyen <cvnguyen@google.com>2015-03-12 19:39:06 -0700
committerChieu Nguyen <cvnguyen@google.com>2015-03-13 12:21:26 -0700
commit116e58c437526ea2503564317e2731b8126acaa4 (patch)
tree8e396e56a3d648e4828218d27e55ec1c06c3dc1e /tests
parent80f90349555ac22f83175e6f19d1ed5e0d673d85 (diff)
downloadandroid_packages_inputmethods_LatinIME-116e58c437526ea2503564317e2731b8126acaa4.tar.gz
android_packages_inputmethods_LatinIME-116e58c437526ea2503564317e2731b8126acaa4.tar.bz2
android_packages_inputmethods_LatinIME-116e58c437526ea2503564317e2731b8126acaa4.zip
Remove autocorrection aggressiveness settings.
Replace multiple settings with binary switch for autocorrection. Bug: 19589766 Change-Id: Ic8a0362dd36d18930493a55699851161e9cb23e8
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTests.java14
-rw-r--r--tests/src/com/android/inputmethod/latin/InputTestsBase.java12
2 files changed, 12 insertions, 14 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
index a6c9bbee0..e09b1e936 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java
@@ -265,7 +265,7 @@ public class InputLogicTests extends InputTestsBase {
public void testDoubleSpacePeriod() {
// Reset settings to default, else these tests will go flaky.
setBooleanPreference(Settings.PREF_SHOW_SUGGESTIONS, true, true);
- setStringPreference(Settings.PREF_AUTO_CORRECTION_THRESHOLD, "1", "1");
+ setBooleanPreference(Settings.PREF_AUTO_CORRECTION, true, true);
setBooleanPreference(Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, true, true);
testDoubleSpacePeriodWithSettings(true /* expectsPeriod */);
// "Suggestion visibility" to off
@@ -277,18 +277,16 @@ public class InputLogicTests extends InputTestsBase {
testDoubleSpacePeriodWithSettings(false, Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, false);
// "Auto-correction" to "off"
- testDoubleSpacePeriodWithSettings(true, Settings.PREF_AUTO_CORRECTION_THRESHOLD, "0");
- // "Auto-correction" to "modest"
- testDoubleSpacePeriodWithSettings(true, Settings.PREF_AUTO_CORRECTION_THRESHOLD, "1");
- // "Auto-correction" to "very aggressive"
- testDoubleSpacePeriodWithSettings(true, Settings.PREF_AUTO_CORRECTION_THRESHOLD, "3");
+ testDoubleSpacePeriodWithSettings(true, Settings.PREF_AUTO_CORRECTION, false);
+ // "Auto-correction" to "on"
+ testDoubleSpacePeriodWithSettings(true, Settings.PREF_AUTO_CORRECTION, true);
// "Suggestion visibility" to "always hide" and "Auto-correction" to "off"
testDoubleSpacePeriodWithSettings(true, Settings.PREF_SHOW_SUGGESTIONS, false,
- Settings.PREF_AUTO_CORRECTION_THRESHOLD, "0");
+ Settings.PREF_AUTO_CORRECTION, false);
// "Suggestion visibility" to "always hide" and "Auto-correction" to "off"
testDoubleSpacePeriodWithSettings(false, Settings.PREF_SHOW_SUGGESTIONS, false,
- Settings.PREF_AUTO_CORRECTION_THRESHOLD, "0",
+ Settings.PREF_AUTO_CORRECTION, false,
Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, false);
}
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
index ea7823c64..d5e93744a 100644
--- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java
+++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
@@ -58,7 +58,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> {
// Default value for auto-correction threshold. This is the string representation of the
// index in the resources array of auto-correction threshold settings.
- private static final String DEFAULT_AUTO_CORRECTION_THRESHOLD = "1";
+ private static final boolean DEFAULT_AUTO_CORRECTION = true;
// The message that sets the underline is posted with a 500 ms delay
protected static final int DELAY_TO_WAIT_FOR_UNDERLINE_MILLIS = 500;
@@ -77,7 +77,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> {
protected MyEditText mEditText;
protected View mInputView;
protected InputConnection mInputConnection;
- private String mPreviousAutoCorrectSetting;
+ private boolean mPreviousAutoCorrectSetting;
// A helper class to ease span tests
public static class SpanGetter {
@@ -200,8 +200,8 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> {
setupService();
mLatinIME = getService();
setDebugMode(true);
- mPreviousAutoCorrectSetting = setStringPreference(Settings.PREF_AUTO_CORRECTION_THRESHOLD,
- DEFAULT_AUTO_CORRECTION_THRESHOLD, DEFAULT_AUTO_CORRECTION_THRESHOLD);
+ mPreviousAutoCorrectSetting = setBooleanPreference(Settings.PREF_AUTO_CORRECTION,
+ DEFAULT_AUTO_CORRECTION, DEFAULT_AUTO_CORRECTION);
mLatinIME.onCreate();
EditorInfo ei = new EditorInfo();
final InputConnection ic = mEditText.onCreateInputConnection(ei);
@@ -230,8 +230,8 @@ public class InputTestsBase extends ServiceTestCase<LatinIMEForTests> {
mLatinIME.onFinishInput();
runMessages();
mLatinIME.mHandler.removeAllMessages();
- setStringPreference(Settings.PREF_AUTO_CORRECTION_THRESHOLD, mPreviousAutoCorrectSetting,
- DEFAULT_AUTO_CORRECTION_THRESHOLD);
+ setBooleanPreference(Settings.PREF_AUTO_CORRECTION, mPreviousAutoCorrectSetting,
+ DEFAULT_AUTO_CORRECTION);
setDebugMode(false);
mLatinIME.recycle();
super.tearDown();