Commit Graph

1775 Commits

Author SHA1 Message Date
samhed 5b7598ac6b Use our own event registration function for keyboardinputReset. 2015-02-06 15:53:10 +01:00
Solly a437079307 Merge pull request #427 from jswanner/register-listeners
Unregister event listeners from websock.
2015-02-04 11:09:37 -05:00
samhed e9f55ea0f8 Fixes issue #435 - added missing comma in keysym.js 2015-02-03 13:04:16 +01:00
Nathaniel Bibler 455f8f3fd0 Replace custom getPosition algorithms with getBoundingClientRect. 2015-01-26 11:46:44 -05:00
samhed b804b3e458 Fixes #428 - hides the local cursor when using the server-side cursor. 2015-01-15 16:27:18 +01:00
Jacob Swanner 155d78b399 Unregister event listeners from websock.
Prevents possible memory and event notification leaks when tearing down
connection and reestablishing a new one.
2015-01-08 15:25:55 -05:00
Alexander Clouter dc4b6301c8 slip in PATH for 'npm test' as not everyone has karma
So people can follow the 'unit tests' instructions, we need
to make sure PATH includes the karma bin directory otherwise
we see the following:
----
aclouter@stevemcqueen:/usr/src/aten-ikvm/noVNC$ npm test

> noVNC@0.5.0 test /usr/src/aten-ikvm/noVNC
> karma start karma.conf.js

sh: 1: karma: not found
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0
----
2014-12-04 21:18:16 +00:00
Samuel fc00821eba Merge pull request #420 from julien-f/patch-1
Loads keysym.js
2014-11-29 10:46:27 +01:00
Julien Fontanet 0331495382 Loads keysym.js
Without it, `XK_ISO_Level3_Shift` (at least) is undefined.
2014-11-28 16:35:55 +01:00
samhed 282834caf1 Fixes #309, make use of keysym.js
Bonus 3 bug fixes:
 * Meta is 0xFFE7 not 0xFE07
 * Super_L is 0xFFEB not 0xFFEC
 * Super_R is 0xFFEC not 0xFFED
2014-11-26 09:24:13 +01:00
samhed ed7f8c3886 Add ISO Level 3 Shift (AltGr) to keysym.js 2014-11-26 09:22:12 +01:00
Solly Ross 4865278dee Fixed Erroneous HEXTILE test
The HEXTILE test which tested for a background tile followed
by an empty tile was only wide enough to actually test for one
tile, thus not actually testing the functionality.  It now actually
uses two tiles, thus actually testing the functionality.
2014-11-24 15:19:04 -05:00
Samuel b2e8311de6 Merge pull request #416 from detain/master
Fix for typo from a recent pull
2014-11-23 17:19:58 +01:00
Joe Huss df89129ff0 Fix for typo from a recent pull
There is a minor typo in the recent pull  Simple fix.
2014-11-23 07:22:39 -05:00
Solly Ross 1f84c99938 Merge "pull-request/412" (ramondeklein/noVNC)
Closes #412
2014-11-17 20:02:42 -05:00
Ramon de Klein 40ac6f0ab6 Don't draw "blank" HEXTILE tiles with random data
Previously, if a HEXTILE tiles was received with a subencoding
of 0x00, it would draw a rectangle using data from the render
queue, which would result in random colored blocks when using
the HEXTILE encoding.  This is the result of a miscopy during
the refactoring.  It now has the correct functionality according
to the RFB protocol specification, which is to draw a rectangle
with the last set background color.

Closes #411
2014-11-17 20:01:28 -05:00
Solly Ross c42ea22525 Fix Karma sinon-chai version issues
Previously, we were using the karma-sinon-chai package to
provide sinon-chai to karma.  This used an older version of
sinon-chai, and looks to be no longer maintained (it's been
a month since sinon-chai was updated).  A new package,
karma-sinon-chai-latest, is now used.  This package uses the
latest version of sinon-chai and sinon, just like karma-chai
uses the latest version of chai.
2014-11-17 17:52:33 -05:00
Solly Ross fda40d8927 Fix broken tests from changing default screen size
Commit 795fca23dc changed the default
size from 640 to 240.  This broke a couple tests which depended on
the default size being 640.  Those tests have now been fixed.
2014-11-17 14:19:19 -05:00
samhed bd6874e087 We should use the globally declared UI variable 2014-11-13 17:22:48 +01:00
samhed 795fca23dc Modify minimum width of clear to accomodate smaller screens 2014-11-11 16:29:06 +01:00
Solly a86f97e284 Merge pull request #410 from kanaka/docs/contributing-guidelines
Added in guidelines for contributing to noVNC
2014-11-06 11:15:11 -05:00
Solly Ross dbaf49f570 Added in guidelines for contributing to noVNC
In CONTRIBUTING.md, you can now find a set of guidelines for
contributing to the noVNC project.  They detail coding style
information, requirements for pull requests, and how to run
the unit tests.
2014-11-02 13:27:06 -05:00
Solly Ross ec31f82eda Fix Cursor Issue When Using True Color
This fixes an issue where, when using true color, the changeCursor
function would not actually write the cursor to the target array.

Fixes #407
2014-10-29 19:18:34 -04:00
Samuel e2f1ff8048 Merge pull request #402 from julien-f/patch-1
Fix subprotocols
2014-10-01 16:46:35 +02:00
Julien Fontanet 58ca1978ea Fix subprotocols
Broken by b1dee94788
2014-10-01 16:30:39 +02:00
Solly Ross 3257d9f265 Force Travis to use Node 0.11.13
The latest version of Node.js has a bug that
affects the Karma test runner.  A patch has been
merged to Karma, but has not landed in a version
yet.  Until a new version of Karma is released,
we should keep node at 0.11.13.

See karma-runner/karma#1182

(cherry picked from commit 9af2346a0cead634f3af5f390770ea65929c1f4a)
2014-09-30 12:21:03 -04:00
Solly 2930403a11 Merge pull request #397 from kanaka/refactor/use-object-defineproperty
Make Utils.js use Object.define to modify Array
2014-09-30 11:57:10 -04:00
Solly Ross f9fd0313b8 Make Utils.js use Object.define to modify Array
Previously, we were modifying Array's prototype using
simple assignment.  This can mess with enumeration/iteration.
Thus, we now use Object.defineProperty with enumerable set to
false.

See #366
2014-09-22 22:30:19 -04:00
Solly Ross 58529d347b Correct Travis CI Badge URL
The readme was using the URL for the 'refactor/cleanup'
branch, which doesn't exist anymore.  It now uses
the badge for the master branch as it should.
2014-09-22 21:49:17 -04:00
Solly Ross b11bb5c385 Add support for Relative Paths in the Test Runner
This patch adds support for using relative paths
with the '-r' or '--relative' methods.  This can
be useful if you want to output HTML (with the
'--output-html' option) and use it in a webpage.

Additionally, the '-o' was removed from the documentation
of '--output-html', since it hasn't worked for that in a
while ('-o' means open in browser instead).
2014-09-22 21:42:32 -04:00
Solly Ross 0b0b0433b5 Fix Race Condition in Display#clear on IE10
There was a race condition in Display#clear on IE10
because we resize and then clear that causes the canvas
to not actually end up cleared.  Clearing the current
viewport first solves the issue.  It doesn't appear to
affect other platforms, so it's inside a engine check
(`Util.Engine.trident === 6`).  Once we stop supporting
IE10, we should just remove this, because it's not the best
to have Engine-specific code.
2014-09-22 21:37:04 -04:00
Solly Ross 3b4fd003c2 Fixed broken mouse test in test.rfb.js
Because we use the XOR (`^`) operator, the button mask must be
set before a MouseUp event happens, otherwise we'll send a pointer
event like it was a MouseDown event.  The button mask was not set
in one of the tests, so the test was failing.
2014-09-19 15:14:34 -04:00
Solly Ross 53762c31fe Fixed Cursor URI Support Detection
There was a bug in cursor URI support detection due to the way
set_defaults now works -- the code was checking for `null`, whereas
when not set, options default to `undefined` unless otherwise
specified.  The code now checks for either `null` or `undefined`.
Tests have been added to ensure that this works properly.
2014-09-19 14:51:15 -04:00
Solly Ross cfc02e5e2b Fixed presence detection bug in utils.set_defaults
Previously, Utils.set_defaults was using `if(conf[keys[i]])`
to check for the presence of a configuration key.  This would
fail if `conf[keys[i]]` happened to be false.  Instead, we now
use `if(keys[i] in conf)`, which simply checks for the presence
of the key in the conf object.
2014-09-19 14:48:00 -04:00
Solly Ross d02a99f0c8 Fixed Typo Causing MouseUp to not Register
There was a typo in one of the instances of the _buttonMask field
(it was written as _buttonMaks), causing MouseUp to never be sent.
This has been rectified, and the unit tests for the mouse handler
have been changed to check for explicitly sending mouseup and
mousedown.

Fixes #393
2014-09-19 14:18:45 -04:00
Solly Ross f0e4548b16 Fix Travis Sauce Tunnel Issues
Travis is failing because Sauce can't find the appropriate tunnelid.
This should fix that but setting the tunnel id to be the Travis
job number.
2014-09-19 12:56:53 -04:00
Solly e4e9a9b97f Merge pull request #391 from mandre/fix_invalid_property
Fix invalid updateState property on RFB preventing noVNC to load
2014-09-19 12:35:27 -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
Solly Ross f8f95d6023 Added Sauce Auth Details for Travis CI
This will enable Travis CI to run tests on Sauce Labs
(thanks to OpenSauce, their free program for Open
Source Software)
2014-09-19 11:43:58 -04:00
Martin André 77bd04f833 Fix invalid updateState property of RFB
It was changed to `onUpdateState` in
b1dee94788.
2014-09-17 16:56:13 +09:00
Martin André 7caa9c20c2 Prevent noVNC loading error when invalid property is set on object
Util.set_defaults should accommodate with missing properties to prevent
'Uncaught TypeError: Cannot read property 'call' of undefined' error.
2014-09-17 16:50:05 +09:00
Solly 0ca7cf4867 Merge pull request #368 from DirectXMan12/refactor/cleanup
Cleanup and test all the things (plus ditching Crockford)!
2014-09-15 16:50:20 -04:00
Solly Ross e6af0f60b0 Add support for Travis CI and SauceLabs Testing
This adds support for Travis CI and SauceLabs
testing.  Testing on SauceLabs in done via
the Karma test runner.  Note that encrypted
Sauce username and access key values need
to be inserted into .travis.yml as global
environment variables.  Additionally, the
local test runner (which is still useful
for debugging tests and code) was updated
to reflect that the 'node_modules' folder
now gets placed in the root directory.
2014-09-15 16:46:02 -04:00
Solly Ross bbbf42bb5a Cleanup: UI code
File: ui.js
Tests Added: False

Changes:
- Fix JSHint errors
- add some curly braces to improve clarity
- move variable declarations to relevant locations instead of at the top
  of methods
2014-09-15 16:46:02 -04:00
Solly Ross b1dee94788 Cleanup: RFB Client
File: rfb.js (also websock.js)
Tests Added: True

Changes:
- De-Crockford-ified rfb.js
- Added methods to websock.js to skip bytes in the receive queue
2014-09-15 16:46:02 -04:00
Solly Ross 1e13775bd5 Cleanup: Display Helper
File: display.js
Tests Added: True (preliminary)

Changes:
- De-crockford-ified the file

NOTE: the tests included for display.js cover basic functionality, but
are by no means nearly as comprehensive as the ones presented for
rfb.js.
2014-09-15 16:46:02 -04:00
Solly Ross 2cccf7530c Cleanup: WebSocket Helper
File: websock.js
Tests Added: True
Changes:
- Cleaned up JSHint errors
- Converted to normal JS constructor pattern with "private" fields and
  methods now simply being prepended by underscores
- Added a "bind" polyfill for use in PhantomJS 1.x in util.js
- Added FakeWebSocket to fill in for actual WebSocket objects when
  testing
- Made exception handler actually log exception name and message,
  to console, in addition to stack trace
2014-09-15 16:46:02 -04:00
Solly Ross ee7d4c61c6 Cleanup: Webutil code
File: webutil.js
Tests Added: False
Changes:
- Fixed JSHint Errors (global "use strict", spaces)
- added some newline characters when appropriate for readability
- moved variable declarations to the places they were actually used
  for readability
2014-09-15 16:46:02 -04:00
Solly Ross 31f169e86f Cleanup: Keyboard code
File: keyboard.js
Tests Added: False (already present)
Changes:
- Fixed JSHint Errors
- Moved functions outside loops
- Added proper include directives to tests
2014-09-15 16:46:02 -04:00
Solly Ross d6e281baf6 Cleanup: Input code
File: input.js
Tests Added: False (already present partially -- see below)
Changes:
- Fixed JSHint Errors
- Converted to normal non-Crockford constructors

NOTE: while there are tests for the actual key-detecting functionality,
      the tests do not cover the actual Keyboard and Mouse objects
      themselves.
2014-09-15 16:46:02 -04:00