]>
Commit | Line | Data |
---|---|---|
f8990704 | 1 | <!DOCTYPE html> |
4ed717ad JM |
2 | <html> |
3 | <head> | |
67b4e987 | 4 | <title>VNC Playback</title> |
4ed717ad JM |
5 | </head> |
6 | <body> | |
7 | ||
b8bd88d0 JM |
8 | Iterations: <input id='iterations' style='width:50'> |
9 | Perftest:<input type='radio' id='mode1' name='mode' checked> | |
10 | Realtime:<input type='radio' id='mode2' name='mode'> | |
4ed717ad JM |
11 | |
12 | <input id='startButton' type='button' value='Start' style='width:100px' | |
13 | onclick="start();" disabled> | |
14 | ||
15 | <br><br> | |
16 | ||
b8bd88d0 JM |
17 | Results:<br> |
18 | <textarea id="messages" style="font-size: 9;" cols=80 rows=25></textarea> | |
19 | ||
20 | <br><br> | |
21 | ||
4ed717ad JM |
22 | <div id="VNC_screen"> |
23 | <div id="VNC_status_bar" class="VNC_status_bar" style="margin-top: 0px;"> | |
24 | <table border=0 width=100%><tr> | |
25 | <td><div id="VNC_status">Loading</div></td> | |
26 | </tr></table> | |
27 | </div> | |
28 | <canvas id="VNC_canvas" width="640px" height="20px"> | |
29 | Canvas not supported. | |
30 | </canvas> | |
31 | </div> | |
32 | ||
4ed717ad JM |
33 | </body> |
34 | ||
35 | <!-- | |
ae510306 | 36 | <script type='text/javascript' |
4ed717ad JM |
37 | src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script> |
38 | --> | |
39 | ||
5e55378b | 40 | <script type="text/javascript"> |
ae510306 | 41 | var INCLUDE_URI= "../"; |
5e55378b | 42 | </script> |
ae510306 SR |
43 | <script src="../core/util.js"></script> |
44 | <script src="../app/webutil.js"></script> | |
4ed717ad JM |
45 | |
46 | <script> | |
b8bd88d0 | 47 | var fname, start_time; |
4ed717ad JM |
48 | |
49 | function message(str) { | |
50 | console.log(str); | |
ae510306 | 51 | var cell = document.getElementById('messages'); |
6048299a | 52 | cell.textContent += str + "\n"; |
4ed717ad JM |
53 | cell.scrollTop = cell.scrollHeight; |
54 | } | |
55 | ||
8d5d2c82 | 56 | fname = WebUtil.getQueryVar('data', null); |
4ed717ad JM |
57 | if (fname) { |
58 | message("Loading " + fname); | |
6f4b1e40 | 59 | // Load supporting scripts |
72bdd06e | 60 | WebUtil.load_scripts({ |
bd5340c7 SR |
61 | 'core': ["base64.js", "websock.js", "des.js", "input/keysym.js", |
62 | "input/keysymdef.js", "input/xtscancodes.js", "input/util.js", | |
63 | "input/devices.js", "display.js", "rfb.js", "inflator.js"], | |
ae510306 SR |
64 | 'tests': ["playback.js"], |
65 | 'recordings': [fname]}); | |
6f4b1e40 | 66 | |
4ed717ad JM |
67 | } else { |
68 | message("Must specify data=FOO in query string."); | |
69 | } | |
70 | ||
f9e26cdb PO |
71 | disconnected = function (rfb, reason) { |
72 | if (reason) { | |
73 | message("noVNC sent '" + state + "' state during iteration " + iteration + " frame " + frame_idx); | |
74 | test_state = 'failed'; | |
4ed717ad JM |
75 | } |
76 | } | |
77 | ||
f9e26cdb | 78 | notification = function (rfb, mesg, level, options) { |
6048299a | 79 | document.getElementById('VNC_status').textContent = mesg; |
f9e26cdb PO |
80 | } |
81 | ||
b8bd88d0 | 82 | function start() { |
ae510306 SR |
83 | document.getElementById('startButton').value = "Running"; |
84 | document.getElementById('startButton').disabled = true; | |
4ed717ad | 85 | |
ae510306 | 86 | iterations = document.getElementById('iterations').value; |
4ed717ad | 87 | iteration = 0; |
4ed717ad JM |
88 | start_time = (new Date()).getTime(); |
89 | ||
ae510306 | 90 | if (document.getElementById('mode1').checked) { |
b8bd88d0 JM |
91 | message("Starting performance playback (fullspeed) [" + iterations + " iteration(s)]"); |
92 | mode = 'perftest'; | |
93 | } else { | |
94 | message("Starting realtime playback [" + iterations + " iteration(s)]"); | |
95 | mode = 'realtime'; | |
4ed717ad JM |
96 | } |
97 | ||
efed2eea SR |
98 | //recv_message = rfb.testMode(send_array, VNC_frame_encoding); |
99 | ||
b8bd88d0 | 100 | next_iteration(); |
4ed717ad JM |
101 | } |
102 | ||
b8bd88d0 JM |
103 | function finish() { |
104 | // Finished with all iterations | |
105 | var total_time, end_time = (new Date()).getTime(); | |
106 | total_time = end_time - start_time; | |
4ed717ad | 107 | |
b8bd88d0 JM |
108 | iter_time = parseInt(total_time / iterations, 10); |
109 | message(iterations + " iterations took " + total_time + "ms, " + | |
110 | iter_time + "ms per iteration"); | |
fa8f14d5 JM |
111 | // Shut-off event interception |
112 | rfb.get_mouse().ungrab(); | |
113 | rfb.get_keyboard().ungrab(); | |
ae510306 SR |
114 | document.getElementById('startButton').disabled = false; |
115 | document.getElementById('startButton').value = "Start"; | |
4ed717ad | 116 | |
4ed717ad JM |
117 | } |
118 | ||
6f4b1e40 | 119 | window.onscriptsload = function () { |
8d5d2c82 | 120 | iterations = WebUtil.getQueryVar('iterations', 3); |
ae510306 | 121 | document.getElementById('iterations').value = iterations; |
8d5d2c82 | 122 | mode = WebUtil.getQueryVar('mode', 3); |
b8bd88d0 | 123 | if (mode === 'realtime') { |
ae510306 | 124 | document.getElementById('mode2').checked = true; |
b8bd88d0 | 125 | } else { |
ae510306 | 126 | document.getElementById('mode1').checked = true; |
b8bd88d0 | 127 | } |
4ed717ad JM |
128 | if (fname) { |
129 | message("VNC_frame_data.length: " + VNC_frame_data.length); | |
4ed717ad | 130 | } |
ae510306 | 131 | document.getElementById('startButton').disabled = false; |
4ed717ad JM |
132 | } |
133 | </script> | |
134 | </html> |