Make resizeSession setting test more realistic

We shouldn't expect a resize request to be sent if the container didn't
change size first.
This commit is contained in:
Pierre Ossman 2025-02-05 16:17:56 +01:00
parent bbbef2d9fa
commit 70446bf742
1 changed files with 7 additions and 0 deletions

View File

@ -1082,6 +1082,13 @@ describe('Remote Frame Buffer protocol client', function () {
it('should only request a resize when turned on', function () { it('should only request a resize when turned on', function () {
client.resizeSession = false; client.resizeSession = false;
expect(RFB.messages.setDesktopSize).to.not.have.been.called; expect(RFB.messages.setDesktopSize).to.not.have.been.called;
container.style.width = '40px';
container.style.height = '50px';
fakeResizeObserver.fire();
clock.tick(1000);
expect(RFB.messages.setDesktopSize).to.not.have.been.called;
client.resizeSession = true; client.resizeSession = true;
expect(RFB.messages.setDesktopSize).to.have.been.calledOnce; expect(RFB.messages.setDesktopSize).to.have.been.calledOnce;
}); });