diff options
author | Solly Ross <sross@redhat.com> | 2014-11-17 20:02:42 -0500 |
---|---|---|
committer | Solly Ross <sross@redhat.com> | 2014-11-17 20:02:42 -0500 |
commit | 1f84c999385220ce5bcb097e3286efd634c62870 (patch) | |
tree | cf8485586c6e20b0c4e384137fb07f53e499faef | |
parent | c42ea22525ffdc7332a96cea96a5b8e7bf40513d (diff) | |
parent | 40ac6f0ab605d4adf8c05bc3dcbc2fce2442d5c4 (diff) | |
download | novnc-1f84c999385220ce5bcb097e3286efd634c62870.tar.gz |
Merge "pull-request/412" (ramondeklein/noVNC)
Closes #412
-rw-r--r-- | include/rfb.js | 3 | ||||
-rw-r--r-- | tests/test.rfb.js | 26 |
2 files changed, 27 insertions, 2 deletions
diff --git a/include/rfb.js b/include/rfb.js index 0afe656..f2f7079 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -1496,8 +1496,7 @@ var RFB; // Weird: ignore blanks are RAW Util.Debug(" Ignoring blank after RAW"); } else { - this._display.fillRect(x, y, w, h, rQ, rQi); - rQi += this._FBU.bytes - 1; + this._display.fillRect(x, y, w, h, FBU.background); } } else if (this._FBU.subencoding & 0x01) { // Raw this._display.blitImage(x, y, w, h, rQ, rQi); 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 = []; |