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:
parent
458405e05d
commit
afbb1da4d5
|
@ -1864,7 +1864,6 @@ export default class RFB extends EventTargetMixin {
|
|||
}
|
||||
})
|
||||
.then(() => {
|
||||
this.dispatchEvent(new CustomEvent('securityresult'));
|
||||
this._rfbInitState = "SecurityResult";
|
||||
return true;
|
||||
}).finally(() => {
|
||||
|
|
|
@ -1631,10 +1631,20 @@ describe('Remote Frame Buffer Protocol Client', function () {
|
|||
client.addEventListener("credentialsrequired", (e) => {
|
||||
client.sendCredentials({ "password": "123456" });
|
||||
clock.tick();
|
||||
});
|
||||
client.addEventListener("securityresult", (event) => {
|
||||
expect(client._sock).to.have.sent(sendData);
|
||||
done();
|
||||
// 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();
|
||||
});
|
||||
}).then(() => {
|
||||
expect(client._sock).to.have.sent(sendData);
|
||||
done();
|
||||
});
|
||||
});
|
||||
client._sock._websocket._receiveData(receiveData);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue