+ // TODO(directxman12): test the various options in this configuration matrix
+ it('should reply with the pixel format, client encodings, and initial update request', function () {
+ send_server_init({ width: 27, height: 32 }, client);
+
+ expect(RFB.messages.pixelFormat).to.have.been.calledOnce;
+ expect(RFB.messages.pixelFormat).to.have.been.calledWith(client._sock, 24, true);
+ expect(RFB.messages.pixelFormat).to.have.been.calledBefore(RFB.messages.clientEncodings);
+ expect(RFB.messages.clientEncodings).to.have.been.calledOnce;
+ expect(RFB.messages.clientEncodings.getCall(0).args[1]).to.include(encodings.encodingTight);
+ expect(RFB.messages.clientEncodings).to.have.been.calledBefore(RFB.messages.fbUpdateRequest);
+ expect(RFB.messages.fbUpdateRequest).to.have.been.calledOnce;
+ expect(RFB.messages.fbUpdateRequest).to.have.been.calledWith(client._sock, false, 0, 0, 27, 32);
+ });
+
+ it('should reply with restricted settings for Intel AMT servers', function () {
+ send_server_init({ width: 27, height: 32, name: "Intel(r) AMT KVM"}, client);
+
+ expect(RFB.messages.pixelFormat).to.have.been.calledOnce;
+ expect(RFB.messages.pixelFormat).to.have.been.calledWith(client._sock, 8, true);
+ expect(RFB.messages.pixelFormat).to.have.been.calledBefore(RFB.messages.clientEncodings);
+ expect(RFB.messages.clientEncodings).to.have.been.calledOnce;
+ expect(RFB.messages.clientEncodings.getCall(0).args[1]).to.not.include(encodings.encodingTight);
+ expect(RFB.messages.clientEncodings.getCall(0).args[1]).to.not.include(encodings.encodingHextile);
+ expect(RFB.messages.clientEncodings).to.have.been.calledBefore(RFB.messages.fbUpdateRequest);
+ expect(RFB.messages.fbUpdateRequest).to.have.been.calledOnce;
+ expect(RFB.messages.fbUpdateRequest).to.have.been.calledWith(client._sock, false, 0, 0, 27, 32);
+ });