Replace resize events with observations in tests

This was missed in commit 375f36c575,
probably because these unit tests still passed (due to the expectancy
was for the code to not act on the resize events).
This commit is contained in:
Samuel Mannehed 2021-12-10 17:53:47 +01:00
parent c0d4dc8eb3
commit acc30093ad
1 changed files with 6 additions and 12 deletions

View File

@ -553,8 +553,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
container.style.width = '40px'; container.style.width = '40px';
container.style.height = '50px'; container.style.height = '50px';
const event = new UIEvent('resize'); fakeResizeObserver.fire();
window.dispatchEvent(event);
clock.tick(); clock.tick();
expect(client._display.viewportChangeSize).to.not.have.been.called; expect(client._display.viewportChangeSize).to.not.have.been.called;
@ -566,8 +565,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
container.style.width = '40px'; container.style.width = '40px';
container.style.height = '50px'; container.style.height = '50px';
const event = new UIEvent('resize'); fakeResizeObserver.fire();
window.dispatchEvent(event);
clock.tick(); clock.tick();
expect(client._display.viewportChangeSize).to.not.have.been.called; expect(client._display.viewportChangeSize).to.not.have.been.called;
@ -748,8 +746,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
container.style.width = '40px'; container.style.width = '40px';
container.style.height = '50px'; container.style.height = '50px';
const event = new UIEvent('resize'); fakeResizeObserver.fire();
window.dispatchEvent(event);
clock.tick(); clock.tick();
expect(client._display.autoscale).to.not.have.been.called; expect(client._display.autoscale).to.not.have.been.called;
@ -859,8 +856,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
container.style.width = '40px'; container.style.width = '40px';
container.style.height = '50px'; container.style.height = '50px';
const event = new UIEvent('resize'); fakeResizeObserver.fire();
window.dispatchEvent(event);
clock.tick(1000); clock.tick(1000);
expect(RFB.messages.setDesktopSize).to.not.have.been.called; expect(RFB.messages.setDesktopSize).to.not.have.been.called;
@ -871,8 +867,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
container.style.width = '40px'; container.style.width = '40px';
container.style.height = '50px'; container.style.height = '50px';
const event = new UIEvent('resize'); fakeResizeObserver.fire();
window.dispatchEvent(event);
clock.tick(1000); clock.tick(1000);
expect(RFB.messages.setDesktopSize).to.not.have.been.called; expect(RFB.messages.setDesktopSize).to.not.have.been.called;
@ -883,8 +878,7 @@ describe('Remote Frame Buffer Protocol Client', function () {
container.style.width = '40px'; container.style.width = '40px';
container.style.height = '50px'; container.style.height = '50px';
const event = new UIEvent('resize'); fakeResizeObserver.fire();
window.dispatchEvent(event);
clock.tick(1000); clock.tick(1000);
expect(RFB.messages.setDesktopSize).to.not.have.been.called; expect(RFB.messages.setDesktopSize).to.not.have.been.called;