diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
index 3b9be43..230739d 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
@@ -62,7 +62,7 @@
     private static final boolean DBG_STRESS_TEST = false;
 
     private static final int TIMEOUT_FOR_READ_OPS_IN_MILLISECONDS = 100;
-    private static final int TIMEOUT_FOR_READ_OPS_FOR_TESTS_IN_MILLISECONDS = 1000;
+    private static final int TIMEOUT_FOR_READ_OPS_FOR_TESTS_IN_MILLISECONDS = 10000;
 
     /**
      * The maximum length of a word in this dictionary.
@@ -750,7 +750,7 @@
     @UsedForTesting
     public boolean isInUnderlyingBinaryDictionaryForTests(final String word) {
         final AsyncResultHolder<Boolean> holder = new AsyncResultHolder<Boolean>();
-        getExecutor(mDictName).executePrioritized(new Runnable() {
+        getExecutor(mDictName).execute(new Runnable() {
             @Override
             public void run() {
                 if (mDictType == Dictionary.TYPE_USER_HISTORY) {
diff --git a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
index dff5a77..449030c 100644
--- a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
+++ b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
@@ -20,6 +20,7 @@
 import android.test.suitebuilder.annotation.LargeTest;
 import android.util.Log;
 
+import com.android.inputmethod.latin.BinaryDictionary;
 import com.android.inputmethod.latin.ExpandableBinaryDictionary;
 import com.android.inputmethod.latin.utils.CollectionUtils;
 import com.android.inputmethod.latin.utils.FileUtils;
@@ -44,6 +45,43 @@
         "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"
     };
 
+    private int mCurrentTime = 0;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        mCurrentTime = 0;
+        setCurrentTimeForTestMode(mCurrentTime);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        stopTestModeInNativeCode();
+        super.tearDown();
+    }
+
+    private void forcePassingShortTime() {
+        // 4 days.
+        final int timeToElapse = (int)TimeUnit.DAYS.toSeconds(4);
+        mCurrentTime += timeToElapse;
+        setCurrentTimeForTestMode(mCurrentTime);
+    }
+
+    private void forcePassingLongTime() {
+        // 60 days.
+        final int timeToElapse = (int)TimeUnit.DAYS.toSeconds(60);
+        mCurrentTime += timeToElapse;
+        setCurrentTimeForTestMode(mCurrentTime);
+    }
+
+    private static int setCurrentTimeForTestMode(final int currentTime) {
+        return BinaryDictionary.setCurrentTimeForTest(currentTime);
+    }
+
+    private static int stopTestModeInNativeCode() {
+        return BinaryDictionary.setCurrentTimeForTest(-1);
+    }
+
     /**
      * Generates a random word.
      */
@@ -207,4 +245,28 @@
             FileUtils.deleteRecursively(dictFile);
         }
     }
+
+    public void testDecaying() {
+        final Locale dummyLocale = new Locale("test_decaying" + System.currentTimeMillis());
+        final int numberOfWords = 5000;
+        final Random random = new Random(123456);
+        clearHistory(dummyLocale);
+        final List<String> words = generateWords(numberOfWords, random);
+        final UserHistoryDictionary dict =
+                PersonalizationHelper.getUserHistoryDictionary(getContext(), dummyLocale);
+        String prevWord = null;
+        for (final String word : words) {
+            dict.addToDictionary(prevWord, word, true, mCurrentTime);
+            prevWord = word;
+            assertTrue(dict.isInUnderlyingBinaryDictionaryForTests(word));
+        }
+        forcePassingShortTime();
+        for (final String word : words) {
+            assertTrue(dict.isInUnderlyingBinaryDictionaryForTests(word));
+        }
+        forcePassingLongTime();
+        for (final String word : words) {
+            assertFalse(dict.isInUnderlyingBinaryDictionaryForTests(word));
+        }
+    }
 }
