Commit fa8f14d5 authored by Joel Martin's avatar Joel Martin

Fix playback of recorded VNC.

- Update test mode calls to work with separate websock module.

- Pull in include/websock.js update 7f487fdbd from websockify.
parent 2270c7b5
......@@ -1512,12 +1512,10 @@ that.clipboardPasteFrom = function(text) {
//Util.Debug("<< clipboardPasteFrom");
};
// Override internal functions for testing
that.testMode = function(override_send) {
// Overridable internal functions for testing
test_mode = true;
// TODO figure out what to do here
ws.send = override_send;
that.recv_message = ws.recv_message; // Expose it
that.recv_message = ws.testMode(override_send);
checkEvents = function () { /* Stub Out */ };
that.connect = function(host, port, password) {
......
......@@ -59,7 +59,9 @@ var api = {}, // Public API
'open' : function() {},
'close' : function() {},
'error' : function() {}
};
},
test_mode = false;
//
......@@ -253,9 +255,13 @@ function init() {
function open(uri) {
init();
websocket = new WebSocket(uri, 'base64');
// TODO: future native binary support
//websocket = new WebSocket(uri, ['binary', 'base64']);
if (test_mode) {
websocket = {};
} else {
websocket = new WebSocket(uri, 'base64');
// TODO: future native binary support
//websocket = new WebSocket(uri, ['binary', 'base64']);
}
websocket.onmessage = recv_message;
websocket.onopen = function() {
......@@ -289,6 +295,15 @@ function close() {
}
}
// Override internal functions for testing
// Takes a send function, returns reference to recv function
function testMode(override_send) {
test_mode = true;
api.send = override_send;
api.close = function () {};
return recv_message;
}
function constructor() {
// Configuration settings
api.maxBufferedAmount = 200;
......@@ -319,6 +334,7 @@ function constructor() {
api.init = init;
api.open = open;
api.close = close;
api.testMode = testMode;
return api;
}
......
......@@ -95,6 +95,7 @@
mode = 'realtime';
}
recv_message = rfb.testMode(send_array);
next_iteration();
}
......@@ -106,7 +107,9 @@
iter_time = parseInt(total_time / iterations, 10);
message(iterations + " iterations took " + total_time + "ms, " +
iter_time + "ms per iteration");
rfb.get_canvas().stop(); // Shut-off event interception
// Shut-off event interception
rfb.get_mouse().ungrab();
rfb.get_keyboard().ungrab();
$D('startButton').disabled = false;
$D('startButton').value = "Start";
......@@ -125,7 +128,6 @@
message("VNC_frame_data.length: " + VNC_frame_data.length);
rfb = new RFB({'target': $D('VNC_canvas'),
'updateState': updateState});
rfb.testMode(send_array);
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment