Bug 1461145: Follow-up follow-up: Fix setTimeout flakiness in tests that load SpecialPowersObserverAPI. r=bustage

MozReview-Commit-ID: 1JTl2Aj1wFK
This commit is contained in:
Kris Maglione 2018-05-26 18:15:19 -07:00
Родитель 3dd63c92d7
Коммит 27f054b14e
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -11,7 +11,6 @@ XPCOMUtils.defineLazyModuleGetters(this, {
ExtensionTestCommon: "resource://testing-common/ExtensionTestCommon.jsm",
NetUtil: "resource://gre/modules/NetUtil.jsm",
Services: "resource://gre/modules/Services.jsm",
setTimeout: "resource://gre/modules/Timer.jsm",
});
this.SpecialPowersError = function(aMsg) {
@ -641,6 +640,7 @@ SpecialPowersObserverAPI.prototype = {
let id = aMessage.data.id;
let extension = this._extensions.get(id);
this._extensions.delete(id);
let {setTimeout} = ChromeUtils.import("resource://gre/modules/Timer.jsm", null);
let done = () => {
setTimeout(() => {
this._sendReply(aMessage, "SPExtensionMessage", {id, type: "extensionUnloaded", args: []});