noVNC/tests
Matt McClaskey bed156c565
KASM-7072 refactor of noVNC rendering of rects (#134)
KASM-7072 Added threaded decoding of rects. Update replay test to work with threaded decoding. Update stats tracker to track dropped fps.

---------

Co-authored-by: ryan.kuba <ryan.kuba@kasmweb.com>
Co-authored-by: Ryan Kuba <ryankuba@gmail.com>
Co-authored-by: Matt McClaskey <matt@kasmweb.com>
2025-05-19 05:34:54 -04:00
..
.eslintrc Enforce function names 2018-09-06 16:53:40 +02:00
README.md KASM-7072 refactor of noVNC rendering of rects (#134) 2025-05-19 05:34:54 -04:00
assertions.js Remove many small, obsolete, old browser hacks 2020-12-07 10:10:53 +01:00
fake.websocket.js Added support for RTCDataChannel 2021-03-04 18:55:06 +00:00
playback-ui.js KASM-7072 refactor of noVNC rendering of rects (#134) 2025-05-19 05:34:54 -04:00
playback.js KASM-7072 refactor of noVNC rendering of rects (#134) 2025-05-19 05:34:54 -04:00
test.base64.js Enforce space after function name 2018-09-06 17:34:15 +02:00
test.copyrect.js Handle empty rects in RAW decoder as well 2020-09-07 12:58:52 +02:00
test.deflator.js Add camelCase rule to eslint 2020-05-31 23:37:29 +02:00
test.display.js Remove createImageData() fallback 2020-12-07 10:10:53 +01:00
test.gesturehandler.js Drop support for Internet Explorer 2020-10-15 18:53:51 +02:00
test.helper.js KASM-5697 Account for improper keyboard implementation of oculus browser (#103) 2024-03-12 08:22:53 -04:00
test.hextile.js Handle empty rects in RAW decoder as well 2020-09-07 12:58:52 +02:00
test.inflator.js rebased tests from upstream, added readme. (#37) 2022-10-11 15:41:02 -04:00
test.int.js Add util for unsigned and signed int. conversion 2020-02-17 11:29:40 +01:00
test.jpeg.js rebased tests from upstream, added readme. (#37) 2022-10-11 15:41:02 -04:00
test.keyboard.js Remove some unnecessary use of done argument 2020-12-10 10:21:21 +01:00
test.localization.js Drop support for Internet Explorer 2020-10-15 18:53:51 +02:00
test.ra2.js rebased tests from upstream, added readme. (#37) 2022-10-11 15:41:02 -04:00
test.raw.js Handle empty rects in RAW decoder as well 2020-09-07 12:58:52 +02:00
test.rfb.js rebased tests from upstream, added readme. (#37) 2022-10-11 15:41:02 -04:00
test.rre.js Handle empty rects in RAW decoder as well 2020-09-07 12:58:52 +02:00
test.tight.js Handle empty rects in RAW decoder as well 2020-09-07 12:58:52 +02:00
test.tightpng.js Add workaround for Firefox PNG rounding bug 2020-09-28 12:24:56 +02:00
test.util.js Standardize on camelCase in Logging 2020-05-31 23:37:29 +02:00
test.websock.js rebased tests from upstream, added readme. (#37) 2022-10-11 15:41:02 -04:00
test.webutil.js rebased tests from upstream, added readme. (#37) 2022-10-11 15:41:02 -04:00
test.zrle.js rebased tests from upstream, added readme. (#37) 2022-10-11 15:41:02 -04:00
vnc_playback.html KASM-7072 refactor of noVNC rendering of rects (#134) 2025-05-19 05:34:54 -04:00

README.md

KasmVNC Client Tests

The page /tests/vnc_playback.html can be used to playback KasmVNC session recordings. The playbacks can be ran in realtime or as fast as possible for performance testing.

Creating new recordings

In order to create a new recording, you will need to disable KasmVNC's built-in web server, enable the legacy VNC TCP port, and disable authentication.

sudo apt-get install websockify
vncserver -noWebsocket -disableBasicAuth
websockify --web /usr/share/kasmvnc/www --record=/home/ubuntu/record.bin 8444 localhost:5901

Websockify automatically adds a number to the end of the filename, so the above example might be record.bin.8. After you are finished recording, Ctrl+C the running websockify process and mv the file to the noVNC www directory.

sudo mkdir /usr/share/kasmvnc/www/recordings
mv /home/ubuntu/record.bin.8 /usr/share/kasmvnc/www/recordings

Playing Back Recordings

Place recordings on the KasmVNC server in the /usr/share/kasmvnc/www/recordings directory, you may need to create this directory. Then navigate to https://server-ip:8444/tests/vnc_playback.html?data=record.bin.8 where record.bin.8 is the name of the playback file you placed in the recordings directory.

If you are running a Dev container for KasmVNC and running the front-end using nodejs, create a directory public/recordings from the root of the frontend code and place the videos in that location.

Threaded Decoding When threaded decoding on the client was added to KasmVNC in 1.4.0, this disrupted the playback testing framework. When threaded encoding is enabled, the client does not block on rendering, therefore the server will send frames as fast as it can regardless of if the client can process the frames or not. In this playback framework, the VNC session recording is played back without a frame rate limit and if threaded decoding is enabled the client will process as much of it as possible and end up discarding frames. To account for this, a target frame rate was added to the playback UI. When testing with threaded decoding enabled, be sure to set the iterations to 1 and provide a target frame rate. Keep increasing the target frame rate until you start dropping frames and then back the frame rate down until you get near 0.

Pre-Test Modifications

Before running performance testing using recording playback, you need to run noVNC from source, rather than the 'compiled' webpack. See the docs at docs/DEVELOP.md for running noVNC from source.

Kasm Provided Recordings

The following recordings are used by Kasm Technologies to provide repeatable performance statisitics using different rendering settings.

Name Description URL
newyork.1 Default 'Static' preset mode. https://kasm-static-content.s3.amazonaws.com/kasmvnc/playbacktests/newyork.1
losangeles.1 Default static preset mode with webp disabled https://kasm-static-content.s3.amazonaws.com/kasmvnc/playbacktests/losangeles.1

Historical Statistics

This table keeps track of performance of pre-defined recordings, defined in the previous section, on static hardware that can be replicated over time to track performance improvements. Multi-threaded decoding was added during noVNC 1.3.0 development, previous testing did not include this feature.

File Commit/Version Threaded Hardware OS Browser Webpacked Result Avg
newyork.1 08233e6 N/A Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 106 False 2446ms
losangeles.1 08233e6 N/A Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 106 False 2272ms
newyork.1 base64opt N/A Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 106 False 2273ms
losangeles.1 base64opt N/A Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 106 False 1847ms
newyork.1 4a6aa73 N/A Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 119 False 2128ms
losangeles.1 4a6aa73 N/A Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 119 False 1766ms
newyork.1 1.3.0 off Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 135 False 1956ms
newyork.1 1.3.0 On Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 135 False 696ms
losangeles.1 1.3.0 off Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 135 False 1166ms
losangeles.1 1.3.0 On Macbook M1 Pro, 32GB RAM macOS 12.2 Chrome 135 False 789ms