Fix performance tests to follow new state API
This commit is contained in:
parent
ab251ad9ea
commit
f9e26cdb32
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue