mirror of
https://git.proxmox.com/git/mirror_novnc
synced 2025-08-10 10:31:06 +00:00
Remove buffer limit tests
We no longer limit writes to the socket.
This commit is contained in:
parent
d2467189f5
commit
c4482d2de5
@ -170,8 +170,7 @@ describe('Websock', function() {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should actually send on the websocket if the websocket does not have too much buffered', function () {
|
it('should actually send on the websocket', function () {
|
||||||
sock.maxBufferedAmount = 10;
|
|
||||||
sock._websocket.bufferedAmount = 8;
|
sock._websocket.bufferedAmount = 8;
|
||||||
sock._websocket.readyState = WebSocket.OPEN
|
sock._websocket.readyState = WebSocket.OPEN
|
||||||
sock._sQ = new Uint8Array([1, 2, 3]);
|
sock._sQ = new Uint8Array([1, 2, 3]);
|
||||||
@ -183,30 +182,14 @@ describe('Websock', function() {
|
|||||||
expect(sock._websocket.send).to.have.been.calledWith(encoded);
|
expect(sock._websocket.send).to.have.been.calledWith(encoded);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return true if the websocket did not have too much buffered', function () {
|
|
||||||
sock.maxBufferedAmount = 10;
|
|
||||||
sock._websocket.bufferedAmount = 8;
|
|
||||||
|
|
||||||
expect(sock.flush()).to.be.true;
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not call send if we do not have anything queued up', function () {
|
it('should not call send if we do not have anything queued up', function () {
|
||||||
sock._sQlen = 0;
|
sock._sQlen = 0;
|
||||||
sock.maxBufferedAmount = 10;
|
|
||||||
sock._websocket.bufferedAmount = 8;
|
sock._websocket.bufferedAmount = 8;
|
||||||
|
|
||||||
sock.flush();
|
sock.flush();
|
||||||
|
|
||||||
expect(sock._websocket.send).not.to.have.been.called;
|
expect(sock._websocket.send).not.to.have.been.called;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should not send and return false if the websocket has too much buffered', function () {
|
|
||||||
sock.maxBufferedAmount = 10;
|
|
||||||
sock._websocket.bufferedAmount = 12;
|
|
||||||
|
|
||||||
expect(sock.flush()).to.be.false;
|
|
||||||
expect(sock._websocket.send).to.not.have.been.called;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('send', function () {
|
describe('send', function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user