Bug 1605674 - Stop using window.setTimeout in MockFilePickerInstance. r=kmag

Using window.setTimeout is causing a Thunderbird test to stall for not entirely clear reasons. Use dispatchToMainThread instead.

Differential Revision: https://phabricator.services.mozilla.com/D59276

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Geoff Lankow 2020-01-14 21:32:56 +00:00
Родитель d980667fad
Коммит 048ed6e9de
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -244,7 +244,7 @@ MockFilePickerInstance.prototype = {
},
open(aFilePickerShownCallback) {
MockFilePicker.showing = true;
this.window.setTimeout(() => {
Services.tm.dispatchToMainThread(() => {
// Maybe all the pending promises are already resolved, but we want to be sure.
Promise.all(MockFilePicker.pendingPromises)
.then(
@ -299,9 +299,9 @@ MockFilePickerInstance.prototype = {
}
if (typeof MockFilePicker.afterOpenCallback == "function") {
this.window.setTimeout(() => {
Services.tm.dispatchToMainThread(() => {
MockFilePicker.afterOpenCallback(this);
}, 0);
});
}
});
});