Don't change state to same state

The comment already stated as much, but the code was broken.
This commit is contained in:
Samuel Mannehed 2016-08-29 14:57:51 +02:00
parent 7d714b15f5
commit 4cfd49c8c3
2 changed files with 5 additions and 1 deletions

View File

@ -442,6 +442,7 @@
if (state === oldstate) {
// Already here, ignore
Util.Debug("Already in state '" + state + "', ignoring");
return;
}
/*

View File

@ -343,7 +343,10 @@ describe('Remote Frame Buffer Protocol Client', function() {
describe('Page States', function () {
describe('loaded', function () {
var client;
beforeEach(function () { client = make_rfb(); });
beforeEach(function () {
client = make_rfb();
client._rfb_state = 'disconnected';
});
it('should close any open WebSocket connection', function () {
sinon.spy(client._sock, 'close');