mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1229195: resolve the promise when the chat window has actually finished loading, not right away. r=Standard8
This commit is contained in:
parent
3f4af88298
commit
69b54120e3
@ -1111,13 +1111,17 @@ var MozLoopServiceInternal = {
|
||||
}, callback);
|
||||
if (!chatboxInstance) {
|
||||
resolve(null);
|
||||
// It's common for unit tests to overload Chat.open.
|
||||
// It's common for unit tests to overload Chat.open, so check if we actually
|
||||
// got a DOM node back.
|
||||
} else if (chatboxInstance.setAttribute) {
|
||||
// Set properties that influence visual appearance of the chatbox right
|
||||
// away to circumvent glitches.
|
||||
chatboxInstance.setAttribute("customSize", "loopDefault");
|
||||
chatboxInstance.parentNode.setAttribute("customSize", "loopDefault");
|
||||
Chat.loadButtonSet(chatboxInstance, "minimize,swap," + kChatboxHangupButton.id);
|
||||
// Final fall-through in case a unit test overloaded Chat.open. Here we can
|
||||
// immediately resolve the promise.
|
||||
} else {
|
||||
resolve(windowId);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user