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 () {
|
||||
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';
|
||||
|
|
Loading…
Reference in New Issue