зеркало из https://github.com/mozilla/gecko-dev.git
Bug 985523 - Convert to Promise.jsm in Places. r=mak
This commit is contained in:
Родитель
804475f701
Коммит
28124f15ce
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче