summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2016-10-24 16:39:35 +0200
committerPierre Ossman <ossman@cendio.se>2016-10-24 17:41:20 +0200
commitf9e26cdb323cecb9eb814b0232d4a25878be8f19 (patch)
tree56e23ede3b901b46e2c4e05533740368fe1f49d7
parentab251ad9ea329be97141c727ba3e3fea2e63ac96 (diff)
downloadnovnc-f9e26cdb323cecb9eb814b0232d4a25878be8f19.tar.gz
Fix performance tests to follow new state API
-rw-r--r--tests/playback.js6
-rw-r--r--tests/vnc_perf.html27
-rw-r--r--tests/vnc_playback.html20
3 files changed, 23 insertions, 30 deletions
diff --git a/tests/playback.js b/tests/playback.js
index 5c94f1e..166d08d 100644
--- a/tests/playback.js
+++ b/tests/playback.js
@@ -30,13 +30,15 @@ enable_test_mode = function () {
this._rfb_password = (password !== undefined) ? password : "";
this._rfb_path = (path !== undefined) ? path : "";
this._sock.init('binary', 'ws');
- this._updateState('ProtocolVersion', "Starting VNC handshake");
+ this._rfb_connection_state = 'connecting';
+ this._rfb_init_state = 'ProtocolVersion';
};
};
next_iteration = function () {
rfb = new RFB({'target': document.getElementById('VNC_canvas'),
- 'onUpdateState': updateState});
+ 'onDisconnected': disconnected,
+ 'onNotification': notification});
enable_test_mode();
// Missing in older recordings
diff --git a/tests/vnc_perf.html b/tests/vnc_perf.html
index 03f4f35..c3e6a11 100644
--- a/tests/vnc_perf.html
+++ b/tests/vnc_perf.html
@@ -74,25 +74,20 @@
}
}
- updateState = function (rfb, state, oldstate, mesg) {
- switch (state) {
- case 'failed':
- case 'fatal':
- msg("noVNC sent '" + state +
- "' state during pass " + pass +
- ", iteration " + iteration +
- " frame " + frame_idx);
- test_state = 'failed';
- break;
- case 'loaded':
- document.getElementById('startButton').disabled = false;
- break;
- }
- if (typeof mesg !== 'undefined') {
- document.getElementById('VNC_status').innerHTML = mesg;
+ disconnected = function (rfb, reason) {
+ if (reason) {
+ msg("noVNC sent '" + state +
+ "' state during pass " + pass +
+ ", iteration " + iteration +
+ " frame " + frame_idx);
+ test_state = 'failed';
}
}
+ notification = function (rfb, mesg, level, options) {
+ document.getElementById('VNC_status').innerHTML = mesg;
+ }
+
function do_test() {
document.getElementById('startButton').value = "Running";
document.getElementById('startButton').disabled = true;
diff --git a/tests/vnc_playback.html b/tests/vnc_playback.html
index edfcacc..510ad06 100644
--- a/tests/vnc_playback.html
+++ b/tests/vnc_playback.html
@@ -68,21 +68,17 @@
message("Must specify data=FOO in query string.");
}
- updateState = function (rfb, state, oldstate, msg) {
- switch (state) {
- case 'failed':
- case 'fatal':
- message("noVNC sent '" + state + "' state during iteration " + iteration + " frame " + frame_idx);
- test_state = 'failed';
- break;
- case 'loaded':
- break;
- }
- if (typeof msg !== 'undefined') {
- document.getElementById('VNC_status').innerHTML = msg;
+ disconnected = function (rfb, reason) {
+ if (reason) {
+ message("noVNC sent '" + state + "' state during iteration " + iteration + " frame " + frame_idx);
+ test_state = 'failed';
}
}
+ notification = function (rfb, mesg, level, options) {
+ document.getElementById('VNC_status').innerHTML = mesg;
+ }
+
function start() {
document.getElementById('startButton').value = "Running";
document.getElementById('startButton').disabled = true;