зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1191130 - Start listening for response before sending async message. r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D36305 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
594ee66f0b
Коммит
9b0fa677c4
|
@ -650,10 +650,6 @@ function setUp(aNoEngine) {
|
|||
}
|
||||
|
||||
function msg(type, data = null) {
|
||||
gMsgMan.sendAsyncMessage(TEST_MSG, {
|
||||
type,
|
||||
data,
|
||||
});
|
||||
return new Promise(resolve => {
|
||||
gMsgMan.addMessageListener(TEST_MSG, function onMsg(msgObj) {
|
||||
if (msgObj.data.type != type) {
|
||||
|
@ -662,6 +658,10 @@ function msg(type, data = null) {
|
|||
gMsgMan.removeMessageListener(TEST_MSG, onMsg);
|
||||
resolve(msgObj.data.data);
|
||||
});
|
||||
gMsgMan.sendAsyncMessage(TEST_MSG, {
|
||||
type,
|
||||
data,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче