aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/InputTestsBase.java
diff options
context:
space:
mode:
authorKurt Partridge <kep@google.com>2012-04-09 18:39:35 -0700
committerKurt Partridge <kep@google.com>2012-04-11 11:17:44 -0700
commitb8e2ae3bc312269897057fccc34cd736c05bcc90 (patch)
tree222f26d25a2b357c55575375db08c69de57fee0b /tests/src/com/android/inputmethod/latin/InputTestsBase.java
parenta601ef03db10089f942f119f316100fbb93ed5e9 (diff)
downloadlatinime-b8e2ae3bc312269897057fccc34cd736c05bcc90.tar.gz
latinime-b8e2ae3bc312269897057fccc34cd736c05bcc90.tar.xz
latinime-b8e2ae3bc312269897057fccc34cd736c05bcc90.zip
change ResearchLoggerTests to check file
multi-project commit with I587003f2 Bug: 6188932 Change-Id: I3d3f0c9d011301489473dc330338ea4a7ba61e9e
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/InputTestsBase.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputTestsBase.java18
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);