summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2022-10-27 16:03:22 +0200
committerPierre Ossman <ossman@cendio.se>2022-10-27 16:03:22 +0200
commit6b555f1f746781e05348cdc9f1c7901dacc0114a (patch)
treeca190ab4100b5121b9fd8c90013c5fc7bf46fca6 /tests
parent0410cbc1908c460eb2d339e2d1a703ba1d07815d (diff)
downloadnovnc-6b555f1f746781e05348cdc9f1c7901dacc0114a.tar.gz
Mask unsupported clipboard characters
Add a more explicit '?' for characters that the clipboard cannot handle, instead of getting random junk.
Diffstat (limited to 'tests')
-rw-r--r--tests/test.rfb.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test.rfb.js b/tests/test.rfb.js
index 432bcba..eb70386 100644
--- a/tests/test.rfb.js
+++ b/tests/test.rfb.js
@@ -433,6 +433,14 @@ describe('Remote Frame Buffer Protocol Client', function () {
new Uint8Array([97, 98, 99]));
});
+ it('should mask unsupported characters', function () {
+ client.clipboardPasteFrom('abc€');
+
+ expect(RFB.messages.clientCutText).to.have.been.calledOnce;
+ expect(RFB.messages.clientCutText).to.have.been.calledWith(client._sock,
+ new Uint8Array([97, 98, 99, 63]));
+ });
+
it('should send an notify if extended clipboard is supported by server', function () {
// Send our capabilities
let data = [3, 0, 0, 0];