summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-01-25 16:14:02 +0100
committerPierre Ossman <ossman@cendio.se>2018-01-25 16:14:02 +0100
commit2a4e84ac20df749063701a348e2fcbf271635c15 (patch)
treefdbdcda68cdf8ed37e3192228835b55fc2e57c77
parentd1aeb435515579c73beaf3641aec0ff5ec322e70 (diff)
downloadnovnc-2a4e84ac20df749063701a348e2fcbf271635c15.tar.gz
Remove old test pages
These are not maintained or used anymore, so just remove them to avoid confusion.
-rw-r--r--tests/input.html128
-rw-r--r--tests/vnc_perf.html206
2 files changed, 0 insertions, 334 deletions
diff --git a/tests/input.html b/tests/input.html
deleted file mode 100644
index 5626178..0000000
--- a/tests/input.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Input Test</title></head>
- <body>
- <br><br>
-
- Canvas:
- <span id="button-selection" style="display: none;">
- <input id="button1" type="button" value="L"><input id="button2" type="button" value="M"><input id="button4" type="button" value="R">
- </span>
- <br>
- <canvas id="canvas" width="640" height="20"
- style="border-style: dotted; border-width: 1px;">
- Canvas not supported.
- </canvas>
-
- <br>
- Results:<br>
- <textarea id="messages" style="font-size: 9;" cols=80 rows=25></textarea>
- </body>
-
- <!--
- <script type='text/javascript'
- src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
- -->
- <script src="../core/util.js"></script>
- <script src="../app/webutil.js"></script>
- <script src="../core/base64.js"></script>
- <script src="../core/input/keysym.js"></script>
- <script src="../core/input/keysymdef.js"></script>
- <script src="../core/input/xtscancodes.js"></script>
- <script src="../core/input/vkeys.js"></script>
- <script src="../core/input/util.js"></script>
- <script src="../core/input/keyboard.js"></script>
- <script src="../core/input/mouse.js"></script>
- <script src="../core/display.js"></script>
- <script>
- var msg_cnt = 0, iterations,
- width = 400, height = 200,
- canvas, keyboard, mouse;
-
- var newline = "\n";
-
- function message(str) {
- console.log(str);
- cell = document.getElementById('messages');
- cell.textContent += msg_cnt + ": " + str + newline;
- cell.scrollTop = cell.scrollHeight;
- msg_cnt++;
- }
-
- function mouseButton(x, y, down, bmask) {
- msg = 'mouse x,y: ' + x + ',' + y + ' down: ' + down;
- msg += ' bmask: ' + bmask;
- message(msg);
- }
-
- function mouseMove(x, y) {
- msg = 'mouse x,y: ' + x + ',' + y;
- //console.log(msg);
- }
-
- function rfbKeyEvent(keysym, code, down) {
- var d = down ? "down" : " up ";
- var msg = "RFB key event " + d + " keysym: " + keysym + " code: " + code;
- message(msg);
- }
- function rawKey(e) {
- msg = "raw key event " + e.type +
- " (key: " + e.keyCode + ", char: " + e.charCode +
- ", which: " + e.which +")";
- message(msg);
- }
-
- function selectButton(num) {
- var b, blist = [1,2,4];
-
- if (typeof num === 'undefined') {
- // Show the default
- num = mouse.get_touchButton();
- } else if (num === mouse.get_touchButton()) {
- // Set all buttons off (no clicks)
- mouse.set_touchButton(0);
- num = 0;
- } else {
- // Turn on one button
- mouse.set_touchButton(num);
- }
-
- for (b = 0; b < blist.length; b++) {
- if (blist[b] === num) {
- document.getElementById('button' + blist[b]).style.backgroundColor = "black";
- document.getElementById('button' + blist[b]).style.color = "lightgray";
- } else {
- document.getElementById('button' + blist[b]).style.backgroundColor = "";
- document.getElementById('button' + blist[b]).style.color = "";
- }
- }
- }
-
- window.onload = function() {
- canvas = new Display({'target' : document.getElementById('canvas')});
- keyboard = new Keyboard({'target': document,
- 'onKeyEvent': rfbKeyEvent});
- document.addEventListener('keypress', rawKey);
- document.addEventListener('keydown', rawKey);
- document.addEventListener('keyup', rawKey);
- mouse = new Mouse({'target': document.getElementById('canvas'),
- 'onMouseButton': mouseButton,
- 'onMouseMove': mouseMove});
-
- canvas.resize(width, height, true);
- keyboard.grab();
- mouse.grab();
- message("Display initialized");
-
- if (Util.isTouchDevice) {
- message("Touch device detected");
- document.getElementById('button-selection').style.display = "inline";
- document.getElementById('button1').onclick = function(){ selectButton(1) };
- document.getElementById('button2').onclick = function(){ selectButton(2) };
- document.getElementById('button4').onclick = function(){ selectButton(4) };
- selectButton();
- }
-
- }
- </script>
-</html>
diff --git a/tests/vnc_perf.html b/tests/vnc_perf.html
deleted file mode 100644
index 6e4f4a3..0000000
--- a/tests/vnc_perf.html
+++ /dev/null
@@ -1,206 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>VNC Performance Benchmark</title>
- </head>
- <body>
-
- Passes: <input id='passes' style='width:50' value=3>&nbsp;
-
- <input id='startButton' type='button' value='Start' style='width:100px'
- onclick="do_test();" disabled>&nbsp;
-
- <br><br>
-
- Results:<br>
- <textarea id="messages" style="font-size: 9;" cols=80 rows=15></textarea>
-
- <br><br>
-
- <div id="VNC_screen">
- <div id="VNC_status_bar" class="VNC_status_bar" style="margin-top: 0px;">
- <table border=0 width=100%><tr>
- <td><div id="VNC_status">Loading</div></td>
- </tr></table>
- </div>
- <canvas id="VNC_canvas" width="640px" height="20px">
- Canvas not supported.
- </canvas>
- </div>
-
- </body>
-
- <!--
- <script type='text/javascript'
- src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
- -->
-
- <script type="text/javascript">
- var INCLUDE_URI= "../";
- </script>
- <script src="../core/util.js"></script>
- <script src="../app/webutil.js"></script>
-
- <script>
- var fname = WebUtil.getQueryVar('data', null);
- if (fname) {
- msg("Loading " + fname);
-
- // Load supporting scripts
- WebUtil.load_scripts({
- 'core': ["base64.js", "websock.js", "des.js", "input/keysym.js",
- "input/keysymdef.js", "input/xtscancodes.js", "input/util.js",
- "input/keyboard.js", "input/mouse.js", "display.js", "rfb.js",
- "inflator.js", "input/vkeys.js", "input/fixedkeys.js"],
- 'tests': ["playback.js"],
- 'recordings': [fname]});
- } else {
- msg("Must specifiy data=FOO.js in query string.");
- }
-
- var start_time, VNC_frame_data, pass, passes, encIdx,
- encOrder = ['raw', 'rre', 'hextile', 'tightpng', 'copyrect'],
- encTot = {}, encMin = {}, encMax = {},
- passCur, passTot, passMin, passMax;
-
- function msg(str) {
- console.log(str);
- var cell = document.getElementById('messages');
- cell.textContent += str + "\n";
- cell.scrollTop = cell.scrollHeight;
- }
- function dbgmsg(str) {
- if (Util.get_logging() === 'debug') {
- msg(str);
- }
- }
-
- disconnected = function (rfb, reason) {
- if (reason) {
- msg("noVNC sent '" + state +
- "' state during pass " + pass +
- ", iteration " + iteration +
- " frame " + frame_idx);
- test_state = 'failed';
- }
- }
-
- function do_test() {
- document.getElementById('startButton').value = "Running";
- document.getElementById('startButton').disabled = true;
-
- mode = 'perftest'; // full-speed
- passes = document.getElementById('passes').value;
- pass = 1;
- encIdx = 0;
-
- // Render each encoding once for each pass
- iterations = 1;
-
- // Initialize stats counters
- for (i = 0; i < encOrder.length; i++) {
- enc = encOrder[i];
- encTot[i] = 0;
- encMin[i] = 2<<23; // Something sufficiently large
- encMax[i] = 0;
- }
- passCur = 0;
- passTot = 0;
- passMin = 2<<23;
- passMax = 0;
-
- // Fire away
- next_encoding();
- }
-
- function next_encoding() {
- var encName;
-
- if (encIdx >= encOrder.length) {
- // Accumulate pass stats
- if (passCur < passMin) {
- passMin = passCur;
- }
- if (passCur > passMax) {
- passMax = passCur;
- }
- msg("Pass " + pass + " took " + passCur + " ms");
-
- passCur = 0;
- encIdx = 0;
- pass += 1;
- if (pass > passes) {
- // We are finished
- // Shut-off event interception
- rfb.get_mouse().ungrab();
- rfb.get_keyboard().ungrab();
- document.getElementById('startButton').disabled = false;
- document.getElementById('startButton').value = "Start";
- finish_passes();
- return; // We are finished, terminate
- }
- }
-
- encName = encOrder[encIdx];
- dbgmsg("Rendering pass " + pass + " encoding '" + encName + "'");
-
- VNC_frame_data = VNC_frame_data_multi[encName];
- iteration = 0;
- start_time = (new Date()).getTime();
-
- next_iteration();
- }
-
- // Finished rendering current encoding
- function finish() {
- var total_time, end_time = (new Date()).getTime();
- total_time = end_time - start_time;
-
- dbgmsg("Encoding " + encOrder[encIdx] + " took " + total_time + "ms");
-
- passCur += total_time;
- passTot += total_time;
-
- // Accumulate stats
- encTot[encIdx] += total_time;
- if (total_time < encMin[encIdx]) {
- encMin[encIdx] = total_time;
- }
- if (total_time > encMax[encIdx]) {
- encMax[encIdx] = total_time;
- }
-
- encIdx += 1;
- next_encoding();
- }
-
- function finish_passes() {
- var i, enc, avg, passAvg;
- msg("STATS (for " + passes + " passes)");
- // Encoding stats
- for (i = 0; i < encOrder.length; i++) {
- enc = encOrder[i];
- avg = (encTot[i] / passes).toFixed(1);
- msg(" " + enc + ": " + encTot[i] + " ms, " +
- encMin[i] + "/" + avg + "/" + encMax[i] +
- " (min/avg/max)");
-
- }
- // Print pass stats
- passAvg = (passTot / passes).toFixed(1);
- msg("\n All passes: " + passTot + " ms, " +
- passMin + "/" + passAvg + "/" + passMax +
- " (min/avg/max)");
- }
-
- window.onscriptsload = function() {
- var i, enc;
- dbgmsg("Frame lengths:");
- for (i = 0; i < encOrder.length; i++) {
- enc = encOrder[i];
- dbgmsg(" " + enc + ": " + VNC_frame_data_multi[enc].length);
- }
- document.getElementById('startButton').disabled = false;
- }
- </script>
-</html>