diff options
author | 2012-04-11 13:19:52 -0700 | |
---|---|---|
committer | 2012-04-11 13:19:52 -0700 | |
commit | fed44d08d886a0b3d37cd28096c602d55b824743 (patch) | |
tree | dd6520827f13c4b94322df86299aea7daa99c9a8 /tests/src/com/android/inputmethod/latin/InputTestsBase.java | |
parent | fad6a2625b86c924f56ab8d4ac51a6ee3e76de64 (diff) | |
parent | b8e2ae3bc312269897057fccc34cd736c05bcc90 (diff) | |
download | latinime-fed44d08d886a0b3d37cd28096c602d55b824743.tar.gz latinime-fed44d08d886a0b3d37cd28096c602d55b824743.tar.xz latinime-fed44d08d886a0b3d37cd28096c602d55b824743.zip |
Merge "change ResearchLoggerTests to check file"
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/InputTestsBase.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index 4dfe22800..9276b40df 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -100,6 +100,17 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { return previousDebugSetting; } + // overload this to configure preferences in a way specific to a subclass's tests + protected void configurePreferences() { + // please avoid changing preferences any more than is necessary, as an interruption + // during a test will leave the user's preferences in a bad state. + } + + // restore any preferences set in configurePreferences() + protected void restorePreferences() { + // undo any effects from configurePreferences() + } + @Override protected void setUp() { try { @@ -113,6 +124,7 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { setupService(); mLatinIME = getService(); final boolean previousDebugSetting = setDebugMode(true); + configurePreferences(); mLatinIME.onCreate(); setDebugMode(previousDebugSetting); initSubtypeMap(); @@ -134,6 +146,12 @@ public class InputTestsBase extends ServiceTestCase<LatinIME> { changeLanguage("en_US"); } + @Override + protected void tearDown() throws Exception { + super.tearDown(); + restorePreferences(); + } + private void initSubtypeMap() { final InputMethodManager imm = (InputMethodManager)mLatinIME.getSystemService( Context.INPUT_METHOD_SERVICE); |