summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2021-11-16 09:38:14 +0100
committerPierre Ossman <ossman@cendio.se>2021-11-16 09:38:14 +0100
commit301714928bfd45a0f11d8cbaec8f9fe538cefe79 (patch)
treea1cc7e127fba840cfda8c9faa2b0400979675502 /tests
parent096449da35aaac925aa3e1da515cc1585e6b54f7 (diff)
downloadnovnc-301714928bfd45a0f11d8cbaec8f9fe538cefe79.tar.gz
Avoid scrolling on RFB object focus
Chrome scrolls the view to show as much as possible of the canvas when we call focus(), which is likely not the desired behaviour. This also exposes the ability to pass on future options when focusing the RFB object manually.
Diffstat (limited to 'tests')
-rw-r--r--tests/test.rfb.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test.rfb.js b/tests/test.rfb.js
index 5f50581..f70bc14 100644
--- a/tests/test.rfb.js
+++ b/tests/test.rfb.js
@@ -392,6 +392,13 @@ describe('Remote Frame Buffer Protocol Client', function () {
client.focus();
expect(client._canvas.focus).to.have.been.calledOnce;
});
+
+ it('should include focus options', function () {
+ client._canvas.focus = sinon.spy();
+ client.focus({ foobar: 12, gazonk: true });
+ expect(client._canvas.focus).to.have.been.calledOnce;
+ expect(client._canvas.focus).to.have.been.calledWith({ foobar: 12, gazonk: true});
+ });
});
describe('#blur', function () {