Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

client: bugfix, request framebuffers updates when expecing, thanks Gu…

…y Sheffer for reporting

 - VNC protocol requires clients to continually request frame buffer updates,
 - vncdotool neverr successfully match, when used with correctly implemented servers,
    as only a single update was requested.
  • Loading branch information...
commit 6e5e748b3b9ff8027a8e65d21c6f02edd72dea0e 1 parent b0243aa
Marc Sibson authored
Showing with 3 additions and 1 deletion.
  1. +2 −0  tests/unit/test_client.py
  2. +1 −1  vncdotool/client.py
2  tests/unit/test_client.py
View
@@ -114,6 +114,7 @@ def test_expectCompareFails(self):
cli.deferred = mock.Mock()
cli.expected = [2, 2, 2]
cli.updates = mock.Mock()
+ cli.framebufferUpdateRequest = mock.Mock()
image = mock.Mock()
image.histogram.return_value = [1, 1, 1]
@@ -121,6 +122,7 @@ def test_expectCompareFails(self):
assert not cli.deferred.callback.called
assert cli.updates.get.called
+ cli.framebufferUpdateRequest.assert_called_once_with(incremental=1)
update = cli.updates.get.return_value
update.addCallback.assert_called_once_with(cli._expectCompare, 0)
2  vncdotool/client.py
View
@@ -190,7 +190,6 @@ def expectScreen(self, filename, maxrms=0):
def _expectCompare(self, image, maxrms):
hist = image.histogram()
-
rms = math.sqrt(
reduce(operator.add, map(
lambda a, b: (a - b) ** 2, hist, self.expected)) / len(hist))
@@ -204,6 +203,7 @@ def _expectCompare(self, image, maxrms):
d = self.updates.get()
d.addCallback(self._expectCompare, maxrms)
+ self.framebufferUpdateRequest(incremental=1)
def mouseMove(self, x, y):
""" Move the mouse pointer to position (x, y)
Please sign in to comment.
Something went wrong with that request. Please try again.