From 7b6e999cd174f63501ccabdade5489d61107b341 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 10 Jan 2014 21:39:02 +0900 Subject: [PATCH] Fix a test. Bug: 12483313 Change-Id: Ia811d614b9260367871bc5717f587538adf46789 --- tests/src/com/android/inputmethod/latin/InputLogicTests.java | 2 +- tests/src/com/android/inputmethod/latin/InputTestsBase.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java index 1a249ce45..2c23d743f 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java @@ -381,7 +381,7 @@ public class InputLogicTests extends InputTestsBase { type(WORD_TO_TYPE); sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); runMessages(); - // Test the first prediction is displayed + // Test the first prediction is not displayed final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); assertEquals("no prediction after period", 0, suggestedWords.size()); } diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java index 84e8a862c..b267bc5da 100644 --- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java @@ -201,6 +201,9 @@ public class InputTestsBase extends ServiceTestCase { mLatinIME.onStartInputView(ei, false); mInputConnection = ic; changeLanguage("en_US"); + // Run messages to avoid the messages enqueued by startInputView() and its friends + // to run on a later call and ruin things. + runMessages(); } @Override