mirror of
https://git.proxmox.com/git/mirror_novnc
synced 2025-08-15 02:43:43 +00:00
Include SetDesktopSize responses in tests
There might be subtle changes in behaviour, so we should mimic what a real server does.
This commit is contained in:
parent
70446bf742
commit
c82178348a
@ -1070,9 +1070,16 @@ describe('Remote Frame Buffer protocol client', function () {
|
|||||||
container.style.width = '70px';
|
container.style.width = '70px';
|
||||||
container.style.height = '80px';
|
container.style.height = '80px';
|
||||||
|
|
||||||
|
sinon.spy(RFB.messages, "setDesktopSize");
|
||||||
|
|
||||||
sendExtendedDesktopSize(client, 0, 0, 4, 4, 0x7890abcd, 0x12345678);
|
sendExtendedDesktopSize(client, 0, 0, 4, 4, 0x7890abcd, 0x12345678);
|
||||||
|
|
||||||
sinon.spy(RFB.messages, "setDesktopSize");
|
if (RFB.messages.setDesktopSize.calledOnce) {
|
||||||
|
let width = RFB.messages.setDesktopSize.args[0][1];
|
||||||
|
let height = RFB.messages.setDesktopSize.args[0][2];
|
||||||
|
sendExtendedDesktopSize(client, 1, 0, width, height, 0x7890abcd, 0x12345678);
|
||||||
|
RFB.messages.setDesktopSize.resetHistory();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function () {
|
afterEach(function () {
|
||||||
@ -1111,6 +1118,7 @@ describe('Remote Frame Buffer protocol client', function () {
|
|||||||
expect(RFB.messages.setDesktopSize).to.have.been.calledWith(
|
expect(RFB.messages.setDesktopSize).to.have.been.calledWith(
|
||||||
sinon.match.object, 70, 80, 0x7890abcd, 0x12345678);
|
sinon.match.object, 70, 80, 0x7890abcd, 0x12345678);
|
||||||
|
|
||||||
|
sendExtendedDesktopSize(client, 1, 0, 70, 80, 0x7890abcd, 0x12345678);
|
||||||
RFB.messages.setDesktopSize.resetHistory();
|
RFB.messages.setDesktopSize.resetHistory();
|
||||||
|
|
||||||
// Second message should not trigger a resize
|
// Second message should not trigger a resize
|
||||||
@ -1163,6 +1171,8 @@ describe('Remote Frame Buffer protocol client', function () {
|
|||||||
expect(RFB.messages.setDesktopSize).to.have.been.calledOnce;
|
expect(RFB.messages.setDesktopSize).to.have.been.calledOnce;
|
||||||
expect(RFB.messages.setDesktopSize).to.have.been.calledWith(
|
expect(RFB.messages.setDesktopSize).to.have.been.calledWith(
|
||||||
sinon.match.object, 40, 50, 0x7890abcd, 0x12345678);
|
sinon.match.object, 40, 50, 0x7890abcd, 0x12345678);
|
||||||
|
|
||||||
|
sendExtendedDesktopSize(client, 1, 0, 40, 50, 0x7890abcd, 0x12345678);
|
||||||
RFB.messages.setDesktopSize.resetHistory();
|
RFB.messages.setDesktopSize.resetHistory();
|
||||||
|
|
||||||
container.style.width = '70px';
|
container.style.width = '70px';
|
||||||
|
Loading…
Reference in New Issue
Block a user