Misc cleanup: debug logging, record filename, etc.

- include/canvas.js: When 'debug' logging, show browser detection
  values.
- test/canvas.html: Only restore the canvas to it's starting state if
  the logging level is not 'debug'.
- wsproxy.py: Append the session number to the record filename so that
  multiple sessions don't stomp on each other.
This commit is contained in:
Joel Martin 2010-09-23 08:17:00 -05:00
parent 8787e49b92
commit 005d9ee999
3 changed files with 13 additions and 5 deletions

View File

@ -89,7 +89,7 @@ function constructor() {
Util.Debug(">> Canvas.init"); Util.Debug(">> Canvas.init");
var c, ctx, imgTest, tval, i, curDat, curSave, var c, ctx, imgTest, tval, i, curDat, curSave,
has_imageData = false; has_imageData = false, UE = Util.Engine;
if (! conf.target) { throw("target must be set"); } if (! conf.target) { throw("target must be set"); }
@ -104,6 +104,11 @@ function constructor() {
if (! conf.ctx) { conf.ctx = c.getContext('2d'); } if (! conf.ctx) { conf.ctx = c.getContext('2d'); }
ctx = conf.ctx; ctx = conf.ctx;
if (UE.gecko) { Util.Debug("Browser: gecko " + UE.gecko); }
if (UE.webkit) { Util.Debug("Browser: webkit " + UE.webkit); }
if (UE.trident) { Util.Debug("Browser: webkit " + UE.trident); }
if (UE.presto) { Util.Debug("Browser: webkit " + UE.presto); }
that.clear(); that.clear();
/* /*

View File

@ -104,8 +104,10 @@
message("prefer Canvas ops: " + time2 + "ms total, " + message("prefer Canvas ops: " + time2 + "ms total, " +
(time2 / iterations) + "ms per frame"); (time2 / iterations) + "ms per frame");
if (Util.get_logging() !== 'debug') {
canvas.resize(start_width, start_height, true); canvas.resize(start_width, start_height, true);
test_functions(); test_functions();
}
$('startButton').disabled = false; $('startButton').disabled = false;
$('startButton').value = "Do Performance Test"; $('startButton').value = "Do Performance Test";
} }

View File

@ -105,7 +105,8 @@ def proxy_handler(client):
if settings['record']: if settings['record']:
handler_msg("opening record file: %s" % settings['record']) handler_msg("opening record file: %s" % settings['record'])
rec = open(settings['record'], 'w+') rec = open("%s.%s" % (settings['record'],
settings['handler_id']), 'w+')
rec.write("var VNC_frame_data = [\n") rec.write("var VNC_frame_data = [\n")
handler_msg("connecting to: %s:%s" % (target_host, target_port)) handler_msg("connecting to: %s:%s" % (target_host, target_port))
@ -131,7 +132,7 @@ if __name__ == '__main__':
parser.add_option("--verbose", "-v", action="store_true", parser.add_option("--verbose", "-v", action="store_true",
help="verbose messages and per frame traffic") help="verbose messages and per frame traffic")
parser.add_option("--record", parser.add_option("--record",
help="record session to a file", metavar="FILE") help="record sessions to FILE.[session_number]", metavar="FILE")
parser.add_option("--foreground", "-f", parser.add_option("--foreground", "-f",
dest="daemon", default=True, action="store_false", dest="daemon", default=True, action="store_false",
help="stay in foreground, do not daemonize") help="stay in foreground, do not daemonize")