diff options
author | Solly Ross <sross@redhat.com> | 2015-03-24 15:05:38 -0400 |
---|---|---|
committer | Solly Ross <sross@redhat.com> | 2015-03-26 17:09:05 -0400 |
commit | 58ded70d150c31df2fbd78c0320af6edc72610fc (patch) | |
tree | 76d6829e35ae6b5f4d2278a547e58f2a1ca1840c /tests | |
parent | 16b3ef77d15179076144d45c9edfdb6d37beb41e (diff) | |
download | novnc-bug/auth-errors-not-displayed.tar.gz |
Create RFB object on connectbug/auth-errors-not-displayed
In e543525faa9cf0d683f41e183e89cd909f3dd229, 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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.display.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/test.display.js b/tests/test.display.js index d54cb82..56dfc22 100644 --- a/tests/test.display.js +++ b/tests/test.display.js @@ -28,35 +28,29 @@ describe('Display/Canvas Helper', function () { describe('checking for cursor uri support', function () { beforeEach(function () { - this._old_change_cursor = Display.changeCursor; + this._old_browser_supports_cursor_uris = Util.browserSupportsCursorURIs; }); it('should disable cursor URIs if there is no support', function () { - Display.changeCursor = function(target) { - target.style.cursor = undefined; - }; + Util.browserSupportsCursorURIs = function () { return false; }; var display = new Display({ target: document.createElement('canvas'), prefer_js: true, viewport: false }); expect(display._cursor_uri).to.be.false; }); it('should enable cursor URIs if there is support', function () { - Display.changeCursor = function(target) { - target.style.cursor = 'pointer'; - }; + Util.browserSupportsCursorURIs = function () { return true; }; var display = new Display({ target: document.createElement('canvas'), prefer_js: true, viewport: false }); expect(display._cursor_uri).to.be.true; }); it('respect the cursor_uri option if there is support', function () { - Display.changeCursor = function(target) { - target.style.cursor = 'pointer'; - }; + Util.browserSupportsCursorURIs = function () { return false; }; var display = new Display({ target: document.createElement('canvas'), prefer_js: true, viewport: false, cursor_uri: false }); expect(display._cursor_uri).to.be.false; }); afterEach(function () { - Display.changeCursor = this._old_change_cursor; + Util.browserSupportsCursorURIs = this._old_browser_supports_cursor_uris; }); }); |