Bug 963475 - Reverse the order of retrieval of message threads. r=gene

This commit is contained in:
Gabriele Svelto 2014-01-27 19:52:11 +01:00
Родитель bc0d73a278
Коммит 156bdefe5c
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -2605,7 +2605,7 @@ MobileMessageDB.prototype = {
if (DEBUG) debug("Caught error on transaction ", event.target.errorCode);
collector.collect(null, COLLECT_ID_ERROR, COLLECT_TIMESTAMP_UNUSED);
};
let request = threadStore.index("lastTimestamp").openKeyCursor();
let request = threadStore.index("lastTimestamp").openKeyCursor(null, PREV);
request.onsuccess = function(event) {
let cursor = event.target.result;
if (cursor) {

Просмотреть файл

@ -376,6 +376,9 @@ checkFuncs.push(checkThread.bind(null, ["thread 18-1", "thread 18-2"],
tasks.push(getAllThreads.bind(null, function(threads) {
is(threads.length, checkFuncs.length, "number of threads got");
// Reverse threads as we iterate over them in reverse order
threads.reverse();
(function callback() {
if (!threads.length) {
tasks.next();