Remove redundant setup of fake timer handling
We already set this up globally, so no need for these extra ones.
This commit is contained in:
parent
68e09edcdc
commit
4a36995363
|
@ -112,9 +112,6 @@ describe('Remote Frame Buffer Protocol Client', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#sendCredentials', function () {
|
describe('#sendCredentials', function () {
|
||||||
beforeEach(function () { this.clock = sinon.useFakeTimers(); });
|
|
||||||
afterEach(function () { this.clock.restore(); });
|
|
||||||
|
|
||||||
it('should set the rfb credentials properly"', function () {
|
it('should set the rfb credentials properly"', function () {
|
||||||
client.sendCredentials({ password: 'pass' });
|
client.sendCredentials({ password: 'pass' });
|
||||||
expect(client._rfb_credentials).to.deep.equal({ 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 () {
|
describe('#_updateConnectionState', function () {
|
||||||
var client;
|
var client;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
this.clock = sinon.useFakeTimers();
|
|
||||||
client = make_rfb();
|
client = make_rfb();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function () {
|
|
||||||
this.clock.restore();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should clear the disconnect timer if the state is not "disconnecting"', function () {
|
it('should clear the disconnect timer if the state is not "disconnecting"', function () {
|
||||||
var spy = sinon.spy();
|
var spy = sinon.spy();
|
||||||
client._disconnTimer = setTimeout(spy, 50);
|
client._disconnTimer = setTimeout(spy, 50);
|
||||||
|
@ -378,15 +370,10 @@ describe('Remote Frame Buffer Protocol Client', function() {
|
||||||
describe('#_fail', function () {
|
describe('#_fail', function () {
|
||||||
var client;
|
var client;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
this.clock = sinon.useFakeTimers();
|
|
||||||
client = make_rfb();
|
client = make_rfb();
|
||||||
client.connect('wss://host:8675');
|
client.connect('wss://host:8675');
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function () {
|
|
||||||
this.clock.restore();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should close the WebSocket connection', function () {
|
it('should close the WebSocket connection', function () {
|
||||||
sinon.spy(client._sock, 'close');
|
sinon.spy(client._sock, 'close');
|
||||||
client._fail();
|
client._fail();
|
||||||
|
@ -470,15 +457,10 @@ describe('Remote Frame Buffer Protocol Client', function() {
|
||||||
describe('disconnecting', function () {
|
describe('disconnecting', function () {
|
||||||
var client;
|
var client;
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
this.clock = sinon.useFakeTimers();
|
|
||||||
client = make_rfb();
|
client = make_rfb();
|
||||||
client.connect('wss://host:8675');
|
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 () {
|
it('should force disconnect if we do not call Websock.onclose within the disconnection timeout', function () {
|
||||||
sinon.spy(client, '_updateConnectionState');
|
sinon.spy(client, '_updateConnectionState');
|
||||||
client._sock._websocket.close = function () {}; // explicitly don't call onclose
|
client._sock._websocket.close = function () {}; // explicitly don't call onclose
|
||||||
|
@ -1965,11 +1947,8 @@ describe('Remote Frame Buffer Protocol Client', function() {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
client = make_rfb();
|
client = make_rfb();
|
||||||
client.connect('wss://host:8675');
|
client.connect('wss://host:8675');
|
||||||
this.clock = sinon.useFakeTimers();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function () { this.clock.restore(); });
|
|
||||||
|
|
||||||
// message events
|
// message events
|
||||||
it ('should do nothing if we receive an empty message and have nothing in the queue', function () {
|
it ('should do nothing if we receive an empty message and have nothing in the queue', function () {
|
||||||
client._rfb_connection_state = 'connected';
|
client._rfb_connection_state = 'connected';
|
||||||
|
|
Loading…
Reference in New Issue