<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <!-- unit test --> <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 src="../resources/openpgp.js"></script> <script src="../resources/keyring.js"></script> <script src="lib/test-bundle.js"></script> <script type="text/javascript"> var test = require('unittests'); function unit_tests() { var table = document.getElementById('unittests'); var single_test = function() { var result = test.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(test.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>