Bug 985523 - Convert to Promise.jsm in Places. r=mak

This commit is contained in:
Paolo Amadini 2014-03-20 11:01:39 +01:00
Родитель 804475f701
Коммит 28124f15ce
4 изменённых файлов: 8 добавлений и 6 удалений

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

@ -42,7 +42,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/commonjs/sdk/core/promise.js");
"resource://gre/modules/Promise.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
"resource://gre/modules/Deprecated.jsm");

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

@ -6,7 +6,7 @@ const TRANSITION_TYPED = Ci.nsINavHistoryService.TRANSITION_TYPED;
Components.utils.import("resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/commonjs/sdk/core/promise.js");
"resource://gre/modules/Promise.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");

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

@ -27,7 +27,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise",
"resource://gre/modules/commonjs/sdk/core/promise.js");
"resource://gre/modules/Promise.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services",
"resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",

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

@ -112,12 +112,14 @@ add_task(function test() {
checkOrder(id1, id3, id2);
// Add a visit, then check frecency ordering.
yield promiseAddVisits({ uri: uri2,
transition: TRANSITION_TYPED});
// When the bookmarks service gets onVisit, it asynchronously fetches all
// items for that visit, and then notifies onItemVisited. Thus we must
// explicitly wait for that.
yield promiseOnItemVisited();
let waitForVisited = promiseOnItemVisited();
yield promiseAddVisits({ uri: uri2,
transition: TRANSITION_TYPED});
yield waitForVisited;
do_print("Sort by frecency desc");
result.sortingMode = NHQO.SORT_BY_FRECENCY_DESCENDING;