From 255fbe0c9e93d26b0edc6c33fdd99dd64e7bc976 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 1 Jun 2017 12:50:00 +0200 Subject: [PATCH] Fix traffic management in playback tests --- tests/playback.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/playback.js b/tests/playback.js index b39c9818..745e1f55 100644 --- a/tests/playback.js +++ b/tests/playback.js @@ -152,11 +152,12 @@ RecordingPlayer.prototype = { _doPacket: function () { // Avoid having excessive queue buildup in non-realtime mode - if (!this._trafficManagement && this._rfb._flushing) { + if (this._trafficManagement && this._rfb._flushing) { let player = this; - this._rfb.display.set_onFlush(function () { - this._rfb._display.set_onFlush(this._rfb._onFlush.bind(this._rfb)); - this._rfb._onFlush(); + let orig = this._rfb._display.get_onFlush(); + this._rfb._display.set_onFlush(function () { + player._rfb._display.set_onFlush(orig); + player._rfb._onFlush(); player._doPacket(); }); return;