]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Remove redundant setup of fake timer handling
authorPierre Ossman <ossman@cendio.se>
Fri, 20 Oct 2017 14:31:49 +0000 (16:31 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 9 Nov 2017 12:13:41 +0000 (13:13 +0100)
We already set this up globally, so no need for these extra ones.

tests/test.rfb.js

index abe48a3fb27eb8f3e1b8a8bf5c18368d537a689f..0a55715de44acda6d18972cd66cc3be13c0b87f2 100644 (file)
@@ -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';