From: Pierre Ossman Date: Fri, 20 Oct 2017 14:31:49 +0000 (+0200) Subject: Remove redundant setup of fake timer handling X-Git-Tag: v1.0.0~43^2~5 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4a3699536312adb7fda0bb2c68ac7dcd1fdbd71e;p=mirror_novnc.git Remove redundant setup of fake timer handling We already set this up globally, so no need for these extra ones. --- diff --git a/tests/test.rfb.js b/tests/test.rfb.js index abe48a3..0a55715 100644 --- a/tests/test.rfb.js +++ b/tests/test.rfb.js @@ -112,9 +112,6 @@ describe('Remote Frame Buffer Protocol Client', function() { }); describe('#sendCredentials', function () { - beforeEach(function () { this.clock = sinon.useFakeTimers(); }); - afterEach(function () { this.clock.restore(); }); - it('should set the rfb credentials properly"', function () { client.sendCredentials({ password: 'pass' }); expect(client._rfb_credentials).to.deep.equal({ password: 'pass' }); @@ -321,14 +318,9 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('#_updateConnectionState', function () { var client; beforeEach(function () { - this.clock = sinon.useFakeTimers(); client = make_rfb(); }); - afterEach(function () { - this.clock.restore(); - }); - it('should clear the disconnect timer if the state is not "disconnecting"', function () { var spy = sinon.spy(); client._disconnTimer = setTimeout(spy, 50); @@ -378,15 +370,10 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('#_fail', function () { var client; beforeEach(function () { - this.clock = sinon.useFakeTimers(); client = make_rfb(); client.connect('wss://host:8675'); }); - afterEach(function () { - this.clock.restore(); - }); - it('should close the WebSocket connection', function () { sinon.spy(client._sock, 'close'); client._fail(); @@ -470,15 +457,10 @@ describe('Remote Frame Buffer Protocol Client', function() { describe('disconnecting', function () { var client; beforeEach(function () { - this.clock = sinon.useFakeTimers(); client = make_rfb(); client.connect('wss://host:8675'); }); - afterEach(function () { - this.clock.restore(); - }); - it('should force disconnect if we do not call Websock.onclose within the disconnection timeout', function () { sinon.spy(client, '_updateConnectionState'); client._sock._websocket.close = function () {}; // explicitly don't call onclose @@ -1965,11 +1947,8 @@ describe('Remote Frame Buffer Protocol Client', function() { beforeEach(function () { client = make_rfb(); client.connect('wss://host:8675'); - this.clock = sinon.useFakeTimers(); }); - afterEach(function () { this.clock.restore(); }); - // message events it ('should do nothing if we receive an empty message and have nothing in the queue', function () { client._rfb_connection_state = 'connected';