diff options
Diffstat (limited to 'tests/test.rfb.js')
-rw-r--r-- | tests/test.rfb.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test.rfb.js b/tests/test.rfb.js index 6233fa8..1510f9e 100644 --- a/tests/test.rfb.js +++ b/tests/test.rfb.js @@ -1312,6 +1312,32 @@ describe('Remote Frame Buffer Protocol Client', function() { expect(client._display).to.have.displayed(new Uint8Array(expected)); }); + it('should handle a tile with only bg specified and an empty frame afterwards', function () { + // set the width so we can have two tiles + client._fb_width = 8; + client._display._fb_width = 8; + client._display._viewportLoc.w = 8; + + var info = [{ x: 0, y: 0, width: 8, height: 4, encoding: 0x05 }]; + + var rect = []; + + // send a bg frame + rect.push(0x02); + rect.push32(0xff00ff); // becomes 00ff00ff --> #00FF00 bg color + + // send an empty frame + rect.push(0x00); + + send_fbu_msg(info, [rect], client); + + var expected = []; + var i; + for (i = 0; i < 16; i++) { expected.push32(0xff00ff); } // rect 1: solid + for (i = 0; i < 16; i++) { expected.push32(0xff00ff); } // rect 2: same bkground color + expect(client._display).to.have.displayed(new Uint8Array(expected)); + }); + it('should handle a tile with bg and coloured subrects', function () { var info = [{ x: 0, y: 0, width: 4, height: 4, encoding: 0x05 }]; var rect = []; |