Commit Graph

13 Commits

Author SHA1 Message Date
Pierre Ossman 7b536961b2 Enforce indentation 2018-09-06 16:37:38 +02:00
Pierre Ossman ae2e1ff7bd Move sinon to karma framework
This frees us from manual imports, and makes things less magical
as those aren't ES modules even if the code suggest that the are.
2018-07-13 15:57:24 +02:00
Juanjo Diaz 651c23ece3 Use fat arrow functions `const foo = () => { ... };` for callbacks
and any other function that is passed around and it's not a top level function
2018-07-12 19:06:57 +02:00
Juanjo Diaz 2b5f94fa6a Prefer const/let over var 2018-05-24 00:27:09 +03:00
Juanjo Diaz 8727f598c2 Add eslint and fix reported issues 2018-05-24 00:25:44 +03:00
Pierre Ossman 0880353ba9 Simpler reporting when display output size mismatches 2017-12-14 12:58:57 +01:00
Samuel Mannehed 13d9108f91 Setup chai extensions centrally
They have global effects so make that clear by doing the setup in a
single place.
2017-09-28 14:10:19 +02:00
Pierre Ossman 02329ab19c Don't violate Display abstraction
Use the normal API as much as possible instead of poking around in
internals that might change.
2016-12-09 09:20:50 +01:00
samhed b1538a0fa4 Fix 'sent' assertion
We were completely mishandling the length of the data. Make sure
we look at the length of the websocket rather than the websock object,
and also compare with the expected length.
2016-06-03 16:31:29 +02:00
Solly Ross bb180145c6 Tests: Fixed bug in displayed assertion
This `displayed` assertion had a bug that was causing it to not
actually check anything (it was using obj.length instead of
data_cl.length).  This fixes that.
2015-08-24 19:30:44 -04:00
Solly Ross 9ff86fb718 Use Typed Arrays for the send queue
This commit converts the send queue to use typed arrays, and converts
message creation functions in 'rfb.js' to create messages directly into
the socket's send queue.  This commit also removes the separate mouse array,
which is no longer needed.
2015-08-06 14:47:03 -04:00
Solly Ross 38781d931e Use Typed Arrays for the Websock receive queue
**This commit removes Base64 (and Flash) support**

This commit converts websock.js to used Typed Arrays for the
receive queue (and tweaks rfb.js to ensure that it continues
to function, since only Firefox implements
`%TypedArray%.prototype.slice`).  Base64 support was removed
to simplify code paths, and pave the way for using Typed Arrays
for the send queue as well.

This provides two advantages: first, we allocate a buffer ahead
of time, meaning the browser doesn't have to do any work dynamically
increasing the receive queue size.  Secondly, we are now able to pass
around Typed Array Views (e.g. `Uint8Array`), which are lightweight, and
don't involve copying.

The downside is that we initially allocate more memory -- we currently
start out with 4 MiB, and then automatically double when it looks like
the amount unused is getting to small.

The commit also explicitly adds a check to the compacting logic that
avoids calling the copy functions if `_rQlen === _rQi`.
2015-08-06 14:47:03 -04:00
Solly Ross 2c9623b5a7 Fixed assertion collision issues
When run via karma, all the tests are loaded into the same page.
This was causing a collision in the 'displayed' assertion dealing
with using viewportLoc.

The assertions are now in their own file, pulled in by tests that
need them.  Additionally, several tests which only set fb_width
and fb_height were correct to set viewportLoc as well.

Closes #392

Also-Authored-By: Martin André (github: mandre)
2014-09-19 12:16:06 -04:00