1. 26 Mar, 2015 1 commit
    • Solly Ross's avatar
      Create RFB object on connect · 58ded70d
      Solly Ross authored
      In e543525f, we switched to creating
      a new RFB object on disconnect.  This caused issues, however, since
      any errors were only displayed briefly before the new "loaded" text
      was displayed instead.
      
      Now, we create the RFB object on connect.  This essentially removes
      the usefulness of the "loaded" state, but prevents the aforementioned
      problem.
      
      To facilitate this, the code which does detection of cursor URI support
      was moved from this Display constructor (which now calls the new
      function) into its own function, `Util.browserSupportsCursorURIs()`.
      
      Fixes #467
      58ded70d
  2. 09 Mar, 2015 1 commit
    • samhed's avatar
      * Don't check specific html elements from the display code (Fixes #446) · fdedbafb
      samhed authored
      * Renamed and reworked fbuClip to clippingDisplay
      * Added tests for clippingDisplay
      * Use the a noVNC_container which covers the entire page to get the full size
        (Fixes #463)
      * Added maxWidth and maxHeight to the canvas which can limit the viewport size
      * Only show either the canvas or the logo, hide one when the other is shown
      * Always center the canvas (previously it was only centered when not clipping)
      * Removed iOS specific "position-fixed" fixes and start calling setBarPosition
        on every resize
      * Removed the noVNC_screen_pad
      fdedbafb
  3. 05 Mar, 2015 1 commit
  4. 03 Mar, 2015 1 commit
    • Solly Ross's avatar
      Support local scaling · 72747869
      Solly Ross authored
      This commit adds two new addition scaling options.  Both options do
      local scaling.  The first "Local Scaling", does both upscaling and
      downscaling.  The second option, "Local Downscaling", only downscales.
      
      This is based on work by @mightypenguin (with an additional bug
      reported by @glazik12).
      72747869
  5. 17 Feb, 2015 1 commit
  6. 10 Feb, 2015 1 commit
  7. 06 Feb, 2015 1 commit
    • samhed's avatar
      Support automatic resize [Part 1/4]: display.js · 636be753
      samhed authored
      * Split viewportChange into two functions, one for changing size and the other for changing position.
      * Modified viewport code to be capable of changing to a bigger size in the context of a
        client-initiated resize.
      * Made clearer distinctions between when viewport-clipping or not.
      * Added public function for telling when viewport-clipping.
      * Updated tests that were using viewportChange.
      636be753
  8. 08 Jan, 2015 1 commit
  9. 24 Nov, 2014 1 commit
    • Solly Ross's avatar
      Fixed Erroneous HEXTILE test · 4865278d
      Solly Ross authored
      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.
      4865278d
  10. 18 Nov, 2014 1 commit
    • Ramon de Klein's avatar
      Don't draw "blank" HEXTILE tiles with random data · 40ac6f0a
      Ramon de Klein authored
      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
      40ac6f0a
  11. 17 Nov, 2014 1 commit
  12. 23 Sep, 2014 1 commit
    • Solly Ross's avatar
      Add support for Relative Paths in the Test Runner · b11bb5c3
      Solly Ross authored
      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).
      b11bb5c3
  13. 19 Sep, 2014 4 commits
    • Solly Ross's avatar
      Fixed broken mouse test in test.rfb.js · 3b4fd003
      Solly Ross authored
      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.
      3b4fd003
    • Solly Ross's avatar
      Fixed Cursor URI Support Detection · 53762c31
      Solly Ross authored
      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.
      53762c31
    • Solly Ross's avatar
      Fixed Typo Causing MouseUp to not Register · d02a99f0
      Solly Ross authored
      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
      d02a99f0
    • Solly Ross's avatar
      Fixed assertion collision issues · 2c9623b5
      Solly Ross authored
      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)
      2c9623b5
  14. 17 Sep, 2014 1 commit
  15. 15 Sep, 2014 9 commits
    • Solly Ross's avatar
      Add support for Travis CI and SauceLabs Testing · e6af0f60
      Solly Ross authored
      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.
      e6af0f60
    • Solly Ross's avatar
      Cleanup: RFB Client · b1dee947
      Solly Ross authored
      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
      b1dee947
    • Solly Ross's avatar
      Cleanup: Display Helper · 1e13775b
      Solly Ross authored
      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.
      1e13775b
    • Solly Ross's avatar
      Cleanup: WebSocket Helper · 2cccf753
      Solly Ross authored
      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
      2cccf753
    • Solly Ross's avatar
      Cleanup: Webutil code · ee7d4c61
      Solly Ross authored
      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
      ee7d4c61
    • Solly Ross's avatar
      Cleanup: Keyboard code · 31f169e8
      Solly Ross authored
      File: keyboard.js
      Tests Added: False (already present)
      Changes:
      - Fixed JSHint Errors
      - Moved functions outside loops
      - Added proper include directives to tests
      31f169e8
    • Solly Ross's avatar
      Cleanup: Util code · d21cd6c1
      Solly Ross authored
      File: util.js
      Tests Added: True (partial -- for logging and array push methods)
      Changes:
      - Fixed JSHint Errors (indentation, semicolons, global "use strict")
      - Made browser detection methods more readable
      - added some newline characters when appropriate for readability
      - throw Errors not strings!
      - Removed conf_defaults, and added make_properties and set_defaults
        instead (see below)
      
      The removal of conf_defaults and switch to make_properties and
      set_defaults is to facilitate the switch over to normal Javascript
      constructors instead of Crockford-style constructors.  Now, methods
      are added to the objects prototype (and thus make properties is called
      outside the constructor).
      d21cd6c1
    • Solly Ross's avatar
      Cleanup and Test: base64.js · f8e9b9f1
      Solly Ross authored
      This is the first commit in a series of commits
      which improve the readability of some of the code
      and add tests.
      
      File: base64.js
      Tests Added: True
      Changes:
      - Improved indentation
      - Fixed JSHint errors
      - Moved loop variables to be declared in the loop for better readability
        (N.B. Javascript does not have block scoping, so the variables are
        still technically available outside the loop -- it just makes the code
        clearer to place them inside the loop, since they are only used there)
      f8e9b9f1
    • Solly Ross's avatar
      Support running all tests from the root directory · 91127741
      Solly Ross authored
      Previously, if you did not specify a tests file,
      you had to be in the 'tests' directory for the
      "run all tests" functionality to work.  Now it
      will work in any directory.
      91127741
  16. 03 Jun, 2014 5 commits
    • Solly Ross's avatar
      Fix race condition in test runner · 9b731d3a
      Solly Ross authored
      Previously, there would be a case where if your tests took
      too long to run, the casper test runner would only report
      on certain tests.  This has been fixed.
      9b731d3a
    • Solly Ross's avatar
      Output error events from provider in test runner · 93af721a
      Solly Ross authored
      Now, 'error' events from the test runner are output to stderr.
      Additionally, when debug is enabled, debug output is logged to
      stderr instead of stdout (as was the case previously).
      93af721a
    • Solly Ross's avatar
      Fixed typo in run_from_console.js · 7187bc12
      Solly Ross authored
      7187bc12
    • Solly Ross's avatar
      Add support for injecting test helper files · d906dfc9
      Solly Ross authored
      Now, the phrase `requires test modules: ` may be place in a comment
      in a file to require modules local to the test directory, similarly
      to the way the `require local modules: ` line may be used to inject
      files in the 'include' directory.  This is useful for when common
      fakes need to be injected into a test.
      d906dfc9
    • Solly Ross's avatar
      Support automatically opening test HTML in browser · 4a4643c0
      Solly Ross authored
      When using the '-g' option with run_from_console.js, you can
      now pass the '-o' option to automatically open the generated
      HTML file in your default browser.  This relies on the 'open'
      NPM module.
      4a4643c0
  17. 06 Jan, 2014 1 commit
    • Jesper Dam's avatar
      Fix issue #326: correct handling of shift key · f6a1d98a
      Jesper Dam authored
      When shortcut modifiers (modifier keys such as CTRL, which do not participate in
      composing character input) are pressed, we try to suppress the keypress
      event, as browsers do not reliably generate it. This means that
      subsequent key events are decoded only based on the keydown event.
      
      Due to a type error (comparing a string to a number), shift was
      mistakenly treated as a shortcut modifier, preventing text input which
      relied on shift, such as _ and %, from being generated.
      f6a1d98a
  18. 17 Dec, 2013 3 commits
    • Solly Ross's avatar
      Support 'requires' Line in Test Runner · 85e89916
      Solly Ross authored
      If the files passed to the '-t' option are all '.js' files (or
      the 'run all tests' option is used) and the '-i' option is not
      passed, all tests will be search for the string
      'require local modules: '.  Only the first instance of this string
      will be used.  Following the colon should be a list of either local
      modules (i.e. files in the '../include/' folder relative to the
      test runner's directory, without the '.js' extension) or paths
      to other Javascript files.  The list of modules and/or files should
      be comma-separated.  These files will then be included in the generated
      HTML file for the appropriate tests as if the '-i' option had been used.
      85e89916
    • Solly Ross's avatar
      Support Running All Tests · d823e895
      Solly Ross authored
      Now, if the '-t' option is passed but no tests are listed,
      all tests in the same directory as the launcher will be run.
      A file is considered a test if it matches the RegEx
      /^test\.(\w|\.|-)+\.js$/ (for those who cannot read PCRE,
      that's roughly 'test.*.js').
      d823e895
    • Solly Ross's avatar
      Support Skipped Tests and Fix JSHint Issues · 8eb88937
      Solly Ross authored
      The test runner now will not break when Mocha skips tests,
      and will properly report them.  Additionally, several JSHint
      warnings were fixed, and a `--debug` option was added to see
      output from the provider.
      8eb88937
  19. 05 Dec, 2013 4 commits
  20. 04 Dec, 2013 1 commit
    • Solly Ross's avatar
      Add support for Outputting Autogenerated Test HTML · 1e570156
      Solly Ross authored
      This commit introduces two flags, '-g' and '-o' to
      the `run_from_console.js`.  Both flags do not run
      the tests.  Instead, deal with the autogenerated
      HTML.  The former outputs the paths to the autogenerated
      HTML temp files, and then pauses the program until Ctrl-C
      is pressed (or SIGINT is sent).  The latter outputs the
      generated HTML for each files to STDIN with the names
      of the tests to which they belong.
      1e570156