sqlite/ext/wasm/tester1-worker.html
stephan 848d27ada1 Add timing info and OPFS sanity tests to tester1.js
FossilOrigin-Name: 99915b0076422487cdd181a54e55694404fba13e4a540329b5ede9e2c9e12532
2022-10-21 06:26:17 +00:00

44 lines
1.4 KiB
HTML

<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
<link rel="stylesheet" href="../common/emscripten.css"/>
<link rel="stylesheet" href="../common/testing.css"/>
<title>sqlite3 tester #1 (Worker thread)</title>
<style>
body {
font-family: monospace;
}
</style>
</head>
<body>
<h1>sqlite3 WASM/JS tester #1 (Worker thread)</h1>
<div id='test-output'></div>
<script>(function(){
const logTarget = document.querySelector('#test-output');
const logHtml = function(cssClass,...args){
const ln = document.createElement('div');
if(cssClass){
for(const c of (Array.isArray(cssClass) ? cssClass : [cssClass])){
ln.classList.add(c);
}
}
ln.append(document.createTextNode(args.join(' ')));
logTarget.append(ln);
};
const w = new Worker("tester1.js?sqlite3.dir=jswasm");
w.onmessage = function({data}){
switch(data.type){
case 'log':
logHtml(data.payload.cssClass, ...data.payload.args);
break;
default:
logHtml('error',"Unhandled message:",data.type);
};
};
})();</script>
</body>
</html>