summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Check for Android using userAgentPierre Ossman2022-12-271-5/+6
| | | | | Modern Android systems seem to report "Linux" for navigator.platform, so we can no longer rely on that.
* Add OS checks for Android and ChromeOSPierre Ossman2022-12-271-1/+43
|
* Add unit tests for OS detectionPierre Ossman2022-12-271-1/+61
|
* Refine browser detectionPierre Ossman2022-12-271-1/+87
| | | | | Try to follow the principle outlined by Mozilla when detecting browsers and engines.
* Add unit tests for browser detectionPierre Ossman2022-12-271-0/+55
|
* Remove test code for old ChromePierre Ossman2022-12-274-79/+9
| | | | | We don't care about ancient versions of Chrome anyway, so let's keep things simple.
* Add MSLogonII security typeDinglan Peng2022-12-211-0/+80
|
* Correctly mask non-BMP clipboard charactersPierre Ossman2022-10-271-0/+8
| | | | | | JavaScript strings use UTF-16 encoding under the hood, but we only want a single '?' per character we replace. So we need to be more careful which methods we use when iterating over the clipboard string.
* Mask unsupported clipboard charactersPierre Ossman2022-10-271-0/+8
| | | | | Add a more explicit '?' for characters that the clipboard cannot handle, instead of getting random junk.
* Remove redundant inspect() overridePierre Ossman2022-10-271-6/+0
| | | | We do this for all RFB tests now, not just these specific assertions.
* Restore Websock.allocateBuffers() after testsPierre Ossman2022-10-271-0/+1
| | | | This was accidentally removed in 0a6aec3578.
* Update method to limit assertion outputPierre Ossman2022-10-271-2/+2
| | | | | Newer versions of the test framework use the inspect() method instead of toString() for overriding the default output.
* auto release keys while meta is held down.Miroslav Šedivý2022-10-151-0/+61
|
* VeNCrypt should handle classical typesPierre Ossman2022-08-181-3/+55
| | | | | VeNCrypt is a superset of the original security types, so it should be fine to send any of the classical values here as well.
* Prefer security types in the server's orderPierre Ossman2022-08-181-11/+3
| | | | | This is how TigerVNC has been behaving for years and has worked well there, so let's follow them.
* Avoiding internal variables for security testsPierre Ossman2022-08-181-78/+59
| | | | | A good test uses only input and output, so let's avoid assuming internal variable names or behaviours.
* Expect security result for RFB 3.7Pierre Ossman2022-08-181-6/+6
| | | | | | The cut off was wrong here. 3.7 will send a security result, but not a security reason. It also fixes the issue that < 3.7 (e.g. 3.3) supports VNC authentication as well.
* Remove redundant security result testsPierre Ossman2022-08-181-27/+5
| | | | | The event is the desired behaviour. RFB._fail() being called is just an internal detail that we shouldn't care about.
* Merge branch 'appleremotedesktop' of https://github.com/pauldumais/noVNCPierre Ossman2022-04-051-2/+75
|\
| * Added support for Apple Remote Desktop authenticationPaul Dumais2022-04-041-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed eslint warnings Fixing tests that failed Added unit tests for ARD authentication Fixed an issue with the ARD rfb version number in the unit tests Fixed issue with username/password lengths Username and password lengths are now capped at 63 characters each. Improved code for sign bit on public key bytes. UTF Encoder username and password before packing it Change UTF encoding to encode the username and password before packing it to prevent it from being expanded beyond the allowed size. Public key is truncated to proper key length. Replaced forge with web crypto for ARD authentication Changed the way in which the async methods are handled, added unit tests to verify ARD encryption output. Update .eslintignore
* | Merge branch 'add-ra2ne-security-type' of https://github.com/pdlan/noVNCPierre Ossman2022-03-101-0/+357
|\ \
| * | Added support for RSA-AES Unencrypted Security Typepdlan2022-03-081-0/+357
| | |
* | | Ignore resize observation caused by server resizesresizeObserverScrollbarsSamuel Mannehed2021-12-131-2/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we increase the remote screen size from the server in such a way that it no longer fits the browser window, the browser will probably want to show scrollbars. The same happens if you enable 'clipping' while the remote is larger than the browser window. These scrollbars do, in turn, decrease the available space in the browser window. This causes our ResizeObserver to trigger. If the resize observation triggers a requestRemoteResize() we will overwrite the size and request a new one just because scrollbars have appeared. We don't want that. We can save the expected client size after resizing, and then compare the current client size with the expected one. If there is no change compared to the expected size, we shouldn't send the request. Fixes issue #1616.
* | | Make sure we wait for the resizeTimeout in testsSamuel Mannehed2021-12-131-5/+5
| | | | | | | | | | | | Not waiting for the full timeout can obscure future bugs.
* | | Replace resize events with observations in testsSamuel Mannehed2021-12-131-12/+6
| | | | | | | | | | | | | | | | | | This was missed in commit 375f36c57544dd89c042a6beceff93a2430f2358, probably because these unit tests still passed (due to the expectancy was for the code to not act on the resize events).
* | | Breakdown of ExtendedDesktopSize message in testsSamuel Mannehed2021-12-131-5/+20
| | | | | | | | | | | | | | | Saves time by not requiring the developer to look up the RFB protocol each time viewing these tests.
* | | Add some explanatory comments to test.rfb.jsSamuel Mannehed2021-12-131-3/+10
|/ /
* | Merge branch 'add-jpeg-encoding' of https://github.com/pdlan/noVNCPierre Ossman2021-11-291-0/+288
|\ \
| * | Add RealVNC's JPEG encodingpdlan2021-11-261-0/+288
| | | | | | | | | | | | | | | | | | Add support for RealVNC's JPEG encoding. Add tests for JPEGDecoder. Fix the corner case of caching Huffman or quantization tables.
* | | Fix lint error in encodings testPierre Ossman2021-11-261-1/+1
| | |
* | | Add missing ZRLE encoding constantPierre Ossman2021-11-261-0/+4
|/ / | | | | | | Also add a unit test to catch omissions like this in the future.
* | Merge branch 'zrle' of https://github.com/pauldumais/noVNCPierre Ossman2021-11-261-0/+124
|\ \
| * | Added support for ZRLE encodingPaul Dumais2021-11-231-0/+124
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed eslint warnings Improved memory usage of zrle decoding. Added unit tests for zrle decoding. Added support for ZRLE encoding Fixed eslint warnings Reverted allowIncomplete changes to Inflator Fixed failing tests for zrle decoder.
* | Avoid scrolling on RFB object focusPierre Ossman2021-11-161-0/+7
| | | | | | | | | | | | | | | | Chrome scrolls the view to show as much as possible of the canvas when we call focus(), which is likely not the desired behaviour. This also exposes the ability to pass on future options when focusing the RFB object manually.
* | Add unit tests for InflatorPierre Ossman2021-11-161-0/+113
|/
* Fix parsing of query string variablesSamuel Mannehed2021-09-081-0/+42
| | | | | | | | | | | This space that was added here was added to the parsed value of the query variable. This broke any comparisons with the value, for example "myvar=true" resulted in a value of "true ". This was broken by f796b05e42cfac7044cca9603e59f258605228f3 The commit also adds unit tests for webutil.getConfigVar() that will detect problems like this in the future.
* Modify unit tests to work with ResizeObserverSamuel Mannehed2021-09-031-10/+22
|
* Update playback test to use new APIPierre Ossman2021-07-221-17/+23
| | | | | | Hooking in to the underlying WebSocket after it has been created no longer works, so clean things up and use the new method of passing an existing object to the RFB constructor.
* Initiate connection from RFB constructorPierre Ossman2021-04-181-31/+7
| | | | | | | | | | | | | We need to do this in order to safely attach to existing WebSocket objects. There may be message events already pending so we must set up our event handlers before returning. This means we will now throw errors instead of generating "disconnect" events on problems as the caller no longer has the opportunity to set up event handlers. This might have been the correct approach from the start as it mimics how e.g. the WebSocket constructor works.
* Don't fake open events in WebsockPierre Ossman2021-04-182-14/+15
| | | | | | | | | | | We don't know if the caller is prepared to receive those events right now as normally they would get them on a fresh new stack later. We also can't delay delivery since then we might deliver the event after any pending "message" events. Better to push the problem one layer up to the caller, which now needs to be more aware of the state of the WebSocket object it is trying to use.
* Refuse to use already closed WebSocket objectsPierre Ossman2021-04-181-0/+11
| | | | We can't do anything useful with them anyway.
* Provide readyState for Websock objectsPierre Ossman2021-04-181-0/+87
| | | | | It mainly reports the state of the underlying object in consistent manner.
* Add unit tests for connect/attach errorsPierre Ossman2021-04-181-0/+25
|
* Add unit tests for passing WebSocket objectsPierre Ossman2021-04-182-1/+32
|
* Stop explicitly testing connection statesPierre Ossman2021-04-181-176/+60
| | | | | These are internal and we should be testing the externally observable behaviour.
* Add VeNCrypt Plain authentication testslhchavez2021-03-131-0/+96
| | | | | This change adds tests for the VeNCrypt Plain authentication. In doing that, this also fixes a typo that was introduced in a recent change.
* Added support for RTCDataChannelTim Stableford2021-03-042-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This work is originally by Ryan Castner <castner.rr@gmail.com> and submitted as a PR here https://github.com/novnc/noVNC/pull/1362 Architecturally it is much the same except it doesn't rename a lot of variables to make this more reviewable. It also avoids unrelated changes such as replacing .onclose with an event listener, which caused numerous test failures. It also adds in ppoffice's fix to initialise the buffers. Like the original author I don't have enough time available to refactor this project to the new style event listeners. Review cleanup for RTCDataChannel support (see below) * More descriptive error when url or channel not set. * Moved websocket property check to WebSock. This had unintended consequences in the tests that required some fixup. Mostly due to some tests not always passing FakeWebsocket. FakeWebsocket also needs to set the listeners to null to be compatible with what is in thw browser and expected by the property check code. The property check code now also takes into account class prototypes for test compatibility. * Removed unreachable code. * Reverted comment. * Cleanup raw channel reference in rfb on websock close. * Use readyState to check whether a socket is open rather than assuming. * Updated RFB constructor documentation Removed an unused boolean passed to attach
* Remove some unnecessary use of done argumentPierre Ossman2020-12-101-8/+4
|
* Fake key releases for some Japanese IM keysPierre Ossman2020-12-101-0/+41
| | | | | | | Windows behaves very oddly for some Japanese IM keys in that it won't send a key release event when the key is released. In some keys it never sends the event, and in some cases it sends the release as the key is pressed the subsequent time.
* Send combination keysyms for some Japanese keysPierre Ossman2020-12-101-0/+33
| | | | | | | Windows doesn't give us stable symbols for a bunch of Japanese IM keys, instead alternating between two symbols. This state is not synchronised with the IM running on the remote server so to have stable behaviour we have to collapse these multiple symbols in to a single keysym.