From 83f9524b8796d94fad56280f6b26c9045fea313f Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 7 Nov 2014 17:10:36 +0900 Subject: Remove the other deprecated constructor to SuggestedWords Change-Id: Ied821df01e032ebc913d2f15dffdf41a51372ea4 --- .../compat/SuggestionSpanUtilsTest.java | 24 +++++++++++++--------- .../inputmethod/latin/SuggestedWordsTests.java | 12 ++++++++--- 2 files changed, 23 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/src/com/android/inputmethod/compat/SuggestionSpanUtilsTest.java b/tests/src/com/android/inputmethod/compat/SuggestionSpanUtilsTest.java index 1c320db1c..7bbf965f9 100644 --- a/tests/src/com/android/inputmethod/compat/SuggestionSpanUtilsTest.java +++ b/tests/src/com/android/inputmethod/compat/SuggestionSpanUtilsTest.java @@ -102,11 +102,11 @@ public class SuggestionSpanUtilsTest extends AndroidTestCase { } public void testGetTextWithSuggestionSpan() { - final SuggestedWordInfo predicition1 = + final SuggestedWordInfo prediction1 = createWordInfo("Quality", SuggestedWordInfo.KIND_PREDICTION); - final SuggestedWordInfo predicition2 = + final SuggestedWordInfo prediction2 = createWordInfo("Speed", SuggestedWordInfo.KIND_PREDICTION); - final SuggestedWordInfo predicition3 = + final SuggestedWordInfo prediction3 = createWordInfo("Price", SuggestedWordInfo.KIND_PREDICTION); final SuggestedWordInfo typed = @@ -122,13 +122,15 @@ public class SuggestionSpanUtilsTest extends AndroidTestCase { // is specified. { final SuggestedWords predictedWords = new SuggestedWords( - new ArrayList<>(Arrays.asList(predicition1, predicition2, predicition3)), + new ArrayList<>(Arrays.asList(prediction1, prediction2, prediction3)), null /* rawSuggestions */, + null /* typedWord */, false /* typedWordValid */, false /* willAutoCorrect */, false /* isObsoleteSuggestions */, - SuggestedWords.INPUT_STYLE_PREDICTION); - final String PICKED_WORD = predicition2.mWord; + SuggestedWords.INPUT_STYLE_PREDICTION, + SuggestedWords.NOT_A_SEQUENCE_NUMBER); + final String PICKED_WORD = prediction2.mWord; assertNotSuggestionSpan( PICKED_WORD, SuggestionSpanUtils.getTextWithSuggestionSpan(getContext(), PICKED_WORD, @@ -137,17 +139,19 @@ public class SuggestionSpanUtilsTest extends AndroidTestCase { final ArrayList suggestedWordList = new ArrayList<>(); suggestedWordList.add(typed); - suggestedWordList.add(predicition1); - suggestedWordList.add(predicition2); - suggestedWordList.add(predicition3); + suggestedWordList.add(prediction1); + suggestedWordList.add(prediction2); + suggestedWordList.add(prediction3); suggestedWordList.addAll(Arrays.asList(corrections)); final SuggestedWords typedAndCollectedWords = new SuggestedWords( suggestedWordList, null /* rawSuggestions */, + null /* typedWord */, false /* typedWordValid */, false /* willAutoCorrect */, false /* isObsoleteSuggestions */, - SuggestedWords.INPUT_STYLE_TYPING); + SuggestedWords.INPUT_STYLE_TYPING, + SuggestedWords.NOT_A_SEQUENCE_NUMBER); for (final SuggestedWordInfo pickedWord : suggestedWordList) { final String PICKED_WORD = pickedWord.mWord; diff --git a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java index 90db75e39..7a7edf031 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java +++ b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java @@ -99,10 +99,12 @@ public class SuggestedWordsTests extends AndroidTestCase { // Make sure getTypedWordInfoOrNull() returns non-null object. final SuggestedWords wordsWithTypedWord = new SuggestedWords( list, null /* rawSuggestions */, + TYPED_WORD, false /* typedWordValid */, false /* willAutoCorrect */, false /* isObsoleteSuggestions */, - SuggestedWords.INPUT_STYLE_NONE); + SuggestedWords.INPUT_STYLE_NONE, + SuggestedWords.NOT_A_SEQUENCE_NUMBER); final SuggestedWordInfo typedWord = wordsWithTypedWord.getTypedWordInfoOrNull(); assertNotNull(typedWord); assertEquals(TYPED_WORD, typedWord.mWord); @@ -111,10 +113,12 @@ public class SuggestedWordsTests extends AndroidTestCase { list.remove(0); final SuggestedWords wordsWithoutTypedWord = new SuggestedWords( list, null /* rawSuggestions */, + null /* typedWord */, false /* typedWordValid */, false /* willAutoCorrect */, false /* isObsoleteSuggestions */, - SuggestedWords.INPUT_STYLE_NONE); + SuggestedWords.INPUT_STYLE_NONE, + SuggestedWords.NOT_A_SEQUENCE_NUMBER); assertNull(wordsWithoutTypedWord.getTypedWordInfoOrNull()); // Make sure getTypedWordInfoOrNull() returns null. @@ -122,10 +126,12 @@ public class SuggestedWordsTests extends AndroidTestCase { final SuggestedWords emptySuggestedWords = new SuggestedWords( new ArrayList(), null /* rawSuggestions */, + null /* typedWord */, false /* typedWordValid */, false /* willAutoCorrect */, false /* isObsoleteSuggestions */, - SuggestedWords.INPUT_STYLE_NONE); + SuggestedWords.INPUT_STYLE_NONE, + SuggestedWords.NOT_A_SEQUENCE_NUMBER); assertNull(emptySuggestedWords.getTypedWordInfoOrNull()); assertNull(SuggestedWords.getEmptyInstance().getTypedWordInfoOrNull()); -- cgit v1.2.3-83-g751a