зеркало из https://github.com/mozilla/gecko-dev.git
Bug 888784 - Make satchel tests wait for FormHistory to be clear when shutting down. r=mak
MozReview-Commit-ID: 9rxyT48VnNj --HG-- extra : rebase_source : b4b0dd42bdda44182bd83baf8715fbe6813e00a5
This commit is contained in:
Родитель
4f3a1a157d
Коммит
8d8d6feabf
|
@ -23,8 +23,10 @@ var ParentUtils = {
|
|||
return entries;
|
||||
},
|
||||
|
||||
cleanUpFormHist() {
|
||||
FormHistory.update({ op: "remove" });
|
||||
cleanUpFormHist(callback) {
|
||||
FormHistory.update({ op: "remove" }, {
|
||||
handleCompletion: callback,
|
||||
});
|
||||
},
|
||||
|
||||
updateFormHistory(changes) {
|
||||
|
@ -116,7 +118,9 @@ var ParentUtils = {
|
|||
|
||||
cleanup() {
|
||||
gAutocompletePopup.removeEventListener("popupshown", this._popupshownListener);
|
||||
this.cleanUpFormHist();
|
||||
this.cleanUpFormHist(() => {
|
||||
sendAsyncMessage("cleanup-done");
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -281,7 +281,13 @@ function satchelCommonSetup() {
|
|||
|
||||
SimpleTest.registerCleanupFunction(() => {
|
||||
gChromeScript.sendAsyncMessage("cleanup");
|
||||
gChromeScript.destroy();
|
||||
return new Promise(resolve => {
|
||||
gChromeScript.addMessageListener("cleanup-done", function done() {
|
||||
gChromeScript.removeMessageListener("cleanup-done", done);
|
||||
gChromeScript.destroy();
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче