From cbad260cf3bc1f0f06aacc305608809545969d9f Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 6 Mar 2012 13:29:50 +0900 Subject: [PATCH] Fix a test To some extent, the test was wrong here. After space is typed in this case, we wait a small delay before updating the suggestion strip so that we can display bigram predictions without introducing delays. The suggestion strip is not displayed until then. The test was bypassing this by simulating a press on the suggestion strip, but for LatinIME it was not displayed yet, hence the bug. The new code waits for the delay, makes sure the suggestion strip is actually displaying punctuation marks, then press the mark and do the intended test on space. Change-Id: I18f82da1bc0a8e584e9b1bac59ff48823d78ec12 --- tests/src/com/android/inputmethod/latin/InputLogicTests.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/src/com/android/inputmethod/latin/InputLogicTests.java b/tests/src/com/android/inputmethod/latin/InputLogicTests.java index 9d53b63f1..50cccec5f 100644 --- a/tests/src/com/android/inputmethod/latin/InputLogicTests.java +++ b/tests/src/com/android/inputmethod/latin/InputLogicTests.java @@ -389,6 +389,10 @@ public class InputLogicTests extends ServiceTestCase { final String PUNCTUATION_FROM_STRIP = "!"; final String EXPECTED_RESULT = "this!! "; type(WORD_TO_TYPE); + sleep(DELAY_TO_WAIT_FOR_UNDERLINE); + runMessages(); + assertTrue("type word then type space should display punctuation strip", + mLatinIME.isShowingPunctuationList()); mLatinIME.pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); mLatinIME.pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); assertEquals("type word then type space then punctuation from strip twice", EXPECTED_RESULT,