]> git.proxmox.com Git - mirror_novnc.git/commit - tests/test.websock.js
Added support for RTCDataChannel
authorTim Stableford <tims@bsquare.com>
Thu, 18 Feb 2021 08:42:34 +0000 (08:42 +0000)
committerTim Stableford <tims@bsquare.com>
Thu, 4 Mar 2021 18:55:06 +0000 (18:55 +0000)
commit44d384b99c78d39601820be1890b83b35847fc7b
treed5da1b8a8b39c08dd3b69f8cf8ef7f3cf82f5880
parent5a0cceb8156926fe125ca541adae60754ecd3698
Added support for RTCDataChannel

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
core/rfb.js
core/websock.js
docs/API.md
tests/fake.websocket.js
tests/test.websock.js