mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 793935 - tests for closing social chat windows on logout. r=jaws
This commit is contained in:
parent
c356d3cd85
commit
0730c6685f
@ -115,5 +115,24 @@ var tests = {
|
||||
}
|
||||
}
|
||||
port.postMessage({topic: "test-worker-chat", data: chatUrl});
|
||||
},
|
||||
testCloseOnLogout: function(next) {
|
||||
const chatUrl = "https://example.com/browser/browser/base/content/test/social_chat.html";
|
||||
let port = Social.provider.getWorkerPort();
|
||||
ok(port, "provider has a port");
|
||||
port.postMessage({topic: "test-init"});
|
||||
port.onmessage = function (e) {
|
||||
let topic = e.data.topic;
|
||||
switch (topic) {
|
||||
case "got-chatbox-message":
|
||||
ok(true, "got a chat window opened");
|
||||
port.postMessage({topic: "test-logout"});
|
||||
waitForCondition(function() document.getElementById("pinnedchats").firstChild == null,
|
||||
next,
|
||||
"chat windows didn't close");
|
||||
break;
|
||||
}
|
||||
}
|
||||
port.postMessage({topic: "test-worker-chat", data: chatUrl});
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,9 @@ onconnect = function(e) {
|
||||
testPort = port;
|
||||
port.postMessage({topic: "test-init-done"});
|
||||
break;
|
||||
case "test-logout":
|
||||
apiPort.postMessage({topic: "social.user-profile", data: {}});
|
||||
break;
|
||||
case "sidebar-message":
|
||||
sidebarPort = port;
|
||||
if (testPort && event.data.result == "ok")
|
||||
|
Loading…
Reference in New Issue
Block a user