Loading java/src/com/android/inputmethod/latin/LatinIME.java +1 −7 Original line number Diff line number Diff line Loading @@ -1307,12 +1307,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // Nothing to do so far. } // TODO: remove this, read this directly from mInputLogic or something in the tests @UsedForTesting public boolean isShowingPunctuationList() { return mInputLogic.isShowingPunctuationList(mSettings.getCurrent()); } // TODO[IL]: Define a clear interface for this public boolean isSuggestionStripVisible() { if (!hasSuggestionStripView()) { Loading Loading @@ -1690,7 +1684,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // TODO: can this be removed somehow without breaking the tests? @UsedForTesting /* package for test */ SuggestedWords getSuggestedWords() { /* package for test */ SuggestedWords getSuggestedWordsForTest() { // You may not use this method for anything else than debug return DEBUG ? mInputLogic.mSuggestedWords : null; } Loading java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +2 −11 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ public final class InputLogic { final SuggestedWords suggestedWords = mSuggestedWords; final String suggestion = suggestionInfo.mWord; // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput if (suggestion.length() == 1 && isShowingPunctuationList(settingsValues)) { if (suggestion.length() == 1 && suggestedWords.isPunctuationSuggestions()) { // Word separators are suggested before the user inputs something. // So, LatinImeLogger logs "" as a user's input. LatinImeLogger.logOnManualSuggestion("", suggestion, index, suggestedWords); Loading Loading @@ -821,7 +821,7 @@ public final class InputLogic { if (maybeDoubleSpacePeriod(settingsValues, handler)) { keyboardSwitcher.updateShiftState(); mSpaceState = SpaceState.DOUBLE; } else if (!isShowingPunctuationList(settingsValues)) { } else if (!mSuggestedWords.isPunctuationSuggestions()) { mSpaceState = SpaceState.WEAK; } } Loading Loading @@ -1455,15 +1455,6 @@ public final class InputLogic { handler.postUpdateSuggestionStrip(); } /** * Find out if the punctuation list is shown in the suggestion strip. * @return whether the current suggestions are the punctuation list. */ // TODO: make this private. It's used through LatinIME for tests. public boolean isShowingPunctuationList(final SettingsValues settingsValues) { return settingsValues.mSpacingAndPunctuations.mSuggestPuncList == mSuggestedWords; } /** * Factor in auto-caps and manual caps and compute the current caps mode. * @param settingsValues the current settings values. Loading tests/src/com/android/inputmethod/latin/InputLogicTests.java +3 −3 Original line number Diff line number Diff line Loading @@ -357,7 +357,7 @@ public class InputLogicTests extends InputTestsBase { sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); runMessages(); // Test the first prediction is displayed final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("predictions after space", "Obama", suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } Loading @@ -371,7 +371,7 @@ public class InputLogicTests extends InputTestsBase { sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); runMessages(); // Test the first prediction is displayed final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("predictions after manual pick", "Obama", suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } Loading @@ -382,7 +382,7 @@ public class InputLogicTests extends InputTestsBase { sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); runMessages(); // Test the first prediction is not displayed final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("no prediction after period", 0, suggestedWords.size()); } } tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ 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(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("predictions in lang without spaces", "Obama", suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } Loading tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java +2 −2 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ public class InputLogicTestsNonEnglish extends InputTestsBase { sleep(DELAY_TO_WAIT_FOR_UNDERLINE); runMessages(); assertTrue("type word then type space should display punctuation strip", mLatinIME.isShowingPunctuationList()); mLatinIME.getSuggestedWordsForTest().isPunctuationSuggestions()); pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); assertEquals("type word then type space then punctuation from strip twice for French", Loading @@ -84,7 +84,7 @@ public class InputLogicTestsNonEnglish extends InputTestsBase { type(WORD_TO_TYPE); sleep(DELAY_TO_WAIT_FOR_UNDERLINE); runMessages(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("type word then type space yields predictions for French", EXPECTED_RESULT, suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } finally { Loading Loading
java/src/com/android/inputmethod/latin/LatinIME.java +1 −7 Original line number Diff line number Diff line Loading @@ -1307,12 +1307,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // Nothing to do so far. } // TODO: remove this, read this directly from mInputLogic or something in the tests @UsedForTesting public boolean isShowingPunctuationList() { return mInputLogic.isShowingPunctuationList(mSettings.getCurrent()); } // TODO[IL]: Define a clear interface for this public boolean isSuggestionStripVisible() { if (!hasSuggestionStripView()) { Loading Loading @@ -1690,7 +1684,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen // TODO: can this be removed somehow without breaking the tests? @UsedForTesting /* package for test */ SuggestedWords getSuggestedWords() { /* package for test */ SuggestedWords getSuggestedWordsForTest() { // You may not use this method for anything else than debug return DEBUG ? mInputLogic.mSuggestedWords : null; } Loading
java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +2 −11 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ public final class InputLogic { final SuggestedWords suggestedWords = mSuggestedWords; final String suggestion = suggestionInfo.mWord; // If this is a punctuation picked from the suggestion strip, pass it to onCodeInput if (suggestion.length() == 1 && isShowingPunctuationList(settingsValues)) { if (suggestion.length() == 1 && suggestedWords.isPunctuationSuggestions()) { // Word separators are suggested before the user inputs something. // So, LatinImeLogger logs "" as a user's input. LatinImeLogger.logOnManualSuggestion("", suggestion, index, suggestedWords); Loading Loading @@ -821,7 +821,7 @@ public final class InputLogic { if (maybeDoubleSpacePeriod(settingsValues, handler)) { keyboardSwitcher.updateShiftState(); mSpaceState = SpaceState.DOUBLE; } else if (!isShowingPunctuationList(settingsValues)) { } else if (!mSuggestedWords.isPunctuationSuggestions()) { mSpaceState = SpaceState.WEAK; } } Loading Loading @@ -1455,15 +1455,6 @@ public final class InputLogic { handler.postUpdateSuggestionStrip(); } /** * Find out if the punctuation list is shown in the suggestion strip. * @return whether the current suggestions are the punctuation list. */ // TODO: make this private. It's used through LatinIME for tests. public boolean isShowingPunctuationList(final SettingsValues settingsValues) { return settingsValues.mSpacingAndPunctuations.mSuggestPuncList == mSuggestedWords; } /** * Factor in auto-caps and manual caps and compute the current caps mode. * @param settingsValues the current settings values. Loading
tests/src/com/android/inputmethod/latin/InputLogicTests.java +3 −3 Original line number Diff line number Diff line Loading @@ -357,7 +357,7 @@ public class InputLogicTests extends InputTestsBase { sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); runMessages(); // Test the first prediction is displayed final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("predictions after space", "Obama", suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } Loading @@ -371,7 +371,7 @@ public class InputLogicTests extends InputTestsBase { sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); runMessages(); // Test the first prediction is displayed final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("predictions after manual pick", "Obama", suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } Loading @@ -382,7 +382,7 @@ public class InputLogicTests extends InputTestsBase { sleep(DELAY_TO_WAIT_FOR_PREDICTIONS); runMessages(); // Test the first prediction is not displayed final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("no prediction after period", 0, suggestedWords.size()); } }
tests/src/com/android/inputmethod/latin/InputLogicTestsLanguageWithoutSpaces.java +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ 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(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("predictions in lang without spaces", "Obama", suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } Loading
tests/src/com/android/inputmethod/latin/InputLogicTestsNonEnglish.java +2 −2 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ public class InputLogicTestsNonEnglish extends InputTestsBase { sleep(DELAY_TO_WAIT_FOR_UNDERLINE); runMessages(); assertTrue("type word then type space should display punctuation strip", mLatinIME.isShowingPunctuationList()); mLatinIME.getSuggestedWordsForTest().isPunctuationSuggestions()); pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); pickSuggestionManually(0, PUNCTUATION_FROM_STRIP); assertEquals("type word then type space then punctuation from strip twice for French", Loading @@ -84,7 +84,7 @@ public class InputLogicTestsNonEnglish extends InputTestsBase { type(WORD_TO_TYPE); sleep(DELAY_TO_WAIT_FOR_UNDERLINE); runMessages(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWords(); final SuggestedWords suggestedWords = mLatinIME.getSuggestedWordsForTest(); assertEquals("type word then type space yields predictions for French", EXPECTED_RESULT, suggestedWords.size() > 0 ? suggestedWords.getWord(0) : null); } finally { Loading