diff --git a/tests/src/com/android/inputmethod/latin/InputTestsBase.java b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
index 9276b40..991635e 100644
--- a/tests/src/com/android/inputmethod/latin/InputTestsBase.java
+++ b/tests/src/com/android/inputmethod/latin/InputTestsBase.java
@@ -90,14 +90,21 @@
         super(LatinIME.class);
     }
 
-    // returns the previous setting value
-    protected boolean setDebugMode(final boolean mode) {
+    // TODO: Isn't there a way to make this generic somehow? We can take a <T> and return a <T>
+    // but we'd have to dispatch types on editor.put...() functions
+    protected boolean setBooleanPreference(final String key, final boolean value,
+            final boolean defaultValue) {
         final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mLatinIME);
-        final boolean previousDebugSetting = prefs.getBoolean(PREF_DEBUG_MODE, false);
+        final boolean previousSetting = prefs.getBoolean(key, defaultValue);
         final SharedPreferences.Editor editor = prefs.edit();
-        editor.putBoolean(PREF_DEBUG_MODE, mode);
+        editor.putBoolean(key, value);
         editor.commit();
-        return previousDebugSetting;
+        return previousSetting;
+    }
+
+    // returns the previous setting value
+    protected boolean setDebugMode(final boolean value) {
+        return setBooleanPreference(PREF_DEBUG_MODE, value, false);
     }
 
     // overload this to configure preferences in a way specific to a subclass's tests
diff --git a/tests/src/com/android/inputmethod/latin/PunctuationTests.java b/tests/src/com/android/inputmethod/latin/PunctuationTests.java
index 1b5b72f..b907970 100644
--- a/tests/src/com/android/inputmethod/latin/PunctuationTests.java
+++ b/tests/src/com/android/inputmethod/latin/PunctuationTests.java
@@ -16,21 +16,36 @@
 
 package com.android.inputmethod.latin;
 
+import com.android.inputmethod.latin.R;
+
 public class PunctuationTests extends InputTestsBase {
 
+    final String NEXT_WORD_PREDICTION_OPTION = "next_word_prediction";
+
     public void testWordThenSpaceThenPunctuationFromStripTwice() {
         final String WORD_TO_TYPE = "this ";
         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,
-                mTextView.getText().toString());
+        final boolean defaultNextWordPredictionOption =
+                mLatinIME.getResources().getBoolean(R.bool.config_default_next_word_suggestions);
+        final boolean previousNextWordPredictionOption =
+                setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, false,
+                        defaultNextWordPredictionOption);
+        try {
+            mLatinIME.loadSettings();
+            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, mTextView.getText().toString());
+        } finally {
+            setBooleanPreference(NEXT_WORD_PREDICTION_OPTION, previousNextWordPredictionOption,
+                    defaultNextWordPredictionOption);
+        }
     }
 
     public void testWordThenSpaceThenPunctuationFromKeyboardTwice() {
