]> git.proxmox.com Git - mirror_novnc.git/blob - tests/test.tight.js
c6823dd5b21b9b9ef5f28c57a4c67b1574f2d81c
[mirror_novnc.git] / tests / test.tight.js
1 const expect = chai.expect;
2
3 import Websock from '../core/websock.js';
4 import Display from '../core/display.js';
5
6 import TightDecoder from '../core/decoders/tight.js';
7
8 import FakeWebSocket from './fake.websocket.js';
9
10 function testDecodeRect(decoder, x, y, width, height, data, display, depth) {
11 let sock;
12
13 sock = new Websock;
14 sock.open("ws://example.com");
15
16 sock.on('message', () => {
17 decoder.decodeRect(x, y, width, height, sock, display, depth);
18 });
19
20 sock._websocket._receiveData(new Uint8Array(data));
21
22 display.flip();
23 }
24
25 describe('Tight Decoder', function () {
26 let decoder;
27 let display;
28
29 before(FakeWebSocket.replace);
30 after(FakeWebSocket.restore);
31
32 beforeEach(function () {
33 decoder = new TightDecoder();
34 display = new Display(document.createElement('canvas'));
35 display.resize(4, 4);
36 });
37
38 it.skip('should handle the Tight encoding', function () {
39 // TODO(directxman12): test this
40 });
41 });