Remove custom RSA-AES event

We shouldn't add extra, undocumented, API just for the tests. They need
to figure out less invasive way to probe things.
This commit is contained in:
Pierre Ossman 2023-05-16 19:38:33 +02:00
parent 458405e05d
commit afbb1da4d5
2 changed files with 14 additions and 5 deletions

View File

@ -1864,7 +1864,6 @@ export default class RFB extends EventTargetMixin {
}
})
.then(() => {
this.dispatchEvent(new CustomEvent('securityresult'));
this._rfbInitState = "SecurityResult";
return true;
}).finally(() => {

View File

@ -1631,11 +1631,21 @@ describe('Remote Frame Buffer Protocol Client', function () {
client.addEventListener("credentialsrequired", (e) => {
client.sendCredentials({ "password": "123456" });
clock.tick();
// FIXME: We don't have a good way to know when
// the async stuff is done, so we hook in
// to this internal function that is
// called at the end
new Promise((resolve, reject) => {
sinon.stub(client._sock._websocket, "send")
.callsFake((data) => {
FakeWebSocket.prototype.send.call(client._sock._websocket, data);
resolve();
});
client.addEventListener("securityresult", (event) => {
}).then(() => {
expect(client._sock).to.have.sent(sendData);
done();
});
});
client._sock._websocket._receiveData(receiveData);
});
});