fork-openpgpjs/test/index.html
2013-04-22 17:04:20 +02:00

140 lines
3.1 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="../resources/openpgp.js"></script>
<!-- unit test -->
<script type="text/javascript" src="unittest.js"></script>
<script type="text/javascript" src="example-test.js"></script>
<script type="text/javascript" src="ciphers/hash/md5.js"></script>
<script type="text/javascript" src="ciphers/hash/sha.js"></script>
<script type="text/javascript" src="ciphers/hash/ripe-md.js"></script>
<script type="text/javascript" src="ciphers/symmetric/aes.js"></script>
<script type="text/javascript" src="ciphers/symmetric/cast5.js"></script>
<script type="text/javascript" src="ciphers/symmetric/des.js"></script>
<script type="text/javascript" src="ciphers/symmetric/blowfish.js"></script>
<script type="text/javascript" src="ciphers/symmetric/twofish.js"></script>
<script type="text/javascript" src="general/packet.js"></script>
<script type="text/javascript" src="ciphers/openpgp.crypto.js"></script>
<script type="text/javascript" src="ciphers/openpgp.sigcheck.js"></script>
<script type="text/javascript" src="general/openpgp.basic.js"></script>
<title>OpenPGP.js testpage</title>
<style>
* {
font-family: monospace;
}
#debug, #testoutput {
border: 1px dotted #aaa;
background-color: #eee;
margin: 5px;
padding: 5px;
}
.successful {
background-color: #afa;
}
.failed {
background-color: #faa;
}
#unittests {
width: 98%;
max-width: 99%;
table-layout: fixed;
word-wrap: break-word;
white-space: pre;
}
#unittests tbody tr th {
background-color: #eee;
border: 1px dotted #aaa;
}
#unittests tbody tr td {
padding: 2px;
border: 1px solid #ccc;
}
.unittesttitle {
font-weight: bold;
vertical-align: top;
}
.unittestrow {
border-top: 1px solid #aaa;
}
</style>
<script type="text/javascript">
util.debug = true;
function unit_tests() {
var table = document.getElementById('unittests');
var single_test = function() {
var result = unittests.run();
var html = '<tr class="unittestrow"><td rowspan="' +
result.tests.length + '" class="unittesttitle">' + result.title + '</td>';
for (var i in result.tests) {
html += (i != 0 ?
'<tr>' : '')
+ '<td>' + result.tests[i].description
+ '</td><td ' + (result.tests[i].result ?
'class="successful">PASSED</td>' :
'class="failed">FAILED</td>')
+ '</tr>';
}
table.innerHTML += html;
if(unittests.tests.length > 0) {
setTimeout(single_test, 100);
}
}
single_test();
}
</script>
</head>
<body>
<a href="index.html">Unit Tests</a> |
<a href="parser.html">Parser</a> |
<a href="encryption.html">Encryption / Decryption</a> |
<a href="coverage.html">Coverage</a>
<h1>Unit tests</h1>
<table id="unittests">
<colgroup>
<col style="width: 20%;">
<col>
<col style="width: 5%;">
</colgroup>
<tr><th>Test</th><th>Description</th><th>Result</th></tr>
</table>
<br>
<button type="submit" onmousedown="unit_tests();">Run unit tests</button>
<!-- src/util/util.js print_debug() writes to -->
<h2>Messages</h2>
<div id="debug"></div>
</body>
</html>