Merge resize handling to single method

It also fits better in the core RFB object rather than as a helper
for the encoding handlers.
This commit is contained in:
Pierre Ossman
2017-09-07 16:51:04 +02:00
parent 1678bf860f
commit 91d5c62589
2 changed files with 25 additions and 30 deletions
+2 -8
View File
@@ -1845,19 +1845,13 @@ describe('Remote Frame Buffer Protocol Client', function() {
var expected_msg = {_sQ: new Uint8Array(10), _sQlen: 0, flush: function() {}};
RFB.messages.enableContinuousUpdates(expected_msg, true, 0, 0, 90, 700);
client._FBU.width = 450;
client._FBU.height = 160;
client._encHandlers.handle_FB_resize();
client._resize(450, 160);
expect(client._sock._websocket._get_sent_data()).to.have.length(0);
client._enabledContinuousUpdates = true;
client._FBU.width = 90;
client._FBU.height = 700;
client._encHandlers.handle_FB_resize();
client._resize(90, 700);
expect(client._sock).to.have.sent(expected_msg._sQ);
});