aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2013-12-18 20:50:05 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-12-18 20:50:05 -0800
commit15732a7280f10d0103619316f3db6a71156c91d1 (patch)
treee221f448c62723057528d8762a0727b681ee85a5 /tests/src
parent08f9d25acc13bfea5a734aa98dcd91fa5c860a54 (diff)
parent553fd66270faec1e4a48b64a522074763c56024f (diff)
downloadlatinime-15732a7280f10d0103619316f3db6a71156c91d1.tar.gz
latinime-15732a7280f10d0103619316f3db6a71156c91d1.tar.xz
latinime-15732a7280f10d0103619316f3db6a71156c91d1.zip
am 553fd662: Merge "Add some info to test crashes to help diagnose flakiness"
* commit '553fd66270faec1e4a48b64a522074763c56024f': Add some info to test crashes to help diagnose flakiness
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java3
-rw-r--r--tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java3
-rw-r--r--tests/src/com/android/inputmethod/latin/PunctuationTests.java9
3 files changed, 11 insertions, 4 deletions
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java
index 0f0ebafb9..89021b4e5 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java
@@ -99,7 +99,8 @@ public class InputLogicTestsLanguageWithoutSpaces extends InputTestsBase {
assertEquals("predictions in lang without spaces", "Barack",
mEditText.getText().toString());
// Test the first prediction is displayed
+ final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords();
assertEquals("predictions in lang without spaces", "Obama",
- mLatinIME.getFirstSuggestedWord());
+ suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null);
}
}
diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java
index 2d736e338..a474c6a8d 100644
--- a/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java
+++ b/tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java
@@ -84,8 +84,9 @@ public class InputLogicTestsNonEnglish extends InputTestsBase {
type(WORD_TO_TYPE);
sleep(DELAY_TO_WAIT_FOR_UNDERLINE);
runMessages();
+ final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords();
assertEquals("type word then type space yields predictions for French",
- EXPECTED_RESULT, mLatinIME.getFirstSuggestedWord());
+ EXPECTED_RESULT, suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null);
} finally {
setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, previousNextWordPredictionOption,
defaultNextWordPredictionOption);
diff --git a/tests/src/com/android/inputmethod/latin/PunctuationTests.java b/tests/src/com/android/inputmethod/latin/PunctuationTests.java
index 84ff6b307..d5c06e223 100644
--- a/tests/src/com/android/inputmethod/latin/PunctuationTests.java
+++ b/tests/src/com/android/inputmethod/latin/PunctuationTests.java
@@ -16,6 +16,7 @@
package com.android.inputmethod.latin;
+import android.provider.Settings.Secure;
import android.test.suitebuilder.annotation.LargeTest;
import com.android.inputmethod.latin.R;
@@ -153,7 +154,9 @@ public class PunctuationTests extends InputTestsBase {
final String WORD_TO_TYPE = "you'f ";
final String EXPECTED_RESULT = "you'd ";
type(WORD_TO_TYPE);
- assertEquals("auto-correction with single quote inside",
+ assertEquals("auto-correction with single quote inside. ID = "
+ + Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID)
+ + " ; Suggestions = " + mLatinIME.getSuggestedWords(),
EXPECTED_RESULT, mEditText.getText().toString());
}
@@ -161,7 +164,9 @@ public class PunctuationTests extends InputTestsBase {
final String WORD_TO_TYPE = "'tgis' ";
final String EXPECTED_RESULT = "'this' ";
type(WORD_TO_TYPE);
- assertEquals("auto-correction with single quotes around",
+ assertEquals("auto-correction with single quotes around. ID = "
+ + Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID)
+ + " ; Suggestions = " + mLatinIME.getSuggestedWords(),
EXPECTED_RESULT, mEditText.getText().toString());
}
}