1402da26cSstephan<!doctype html>
2402da26cSstephan<html lang="en-us">
3402da26cSstephan  <head>
4402da26cSstephan    <meta charset="utf-8">
5402da26cSstephan    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6402da26cSstephan    <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
7402da26cSstephan    <link rel="stylesheet" href="../common/emscripten.css"/>
8402da26cSstephan    <link rel="stylesheet" href="../common/testing.css"/>
9402da26cSstephan    <title>sqlite3 tester #1 (Worker thread)</title>
10402da26cSstephan    <style>
11402da26cSstephan      body {
12402da26cSstephan          font-family: monospace;
13402da26cSstephan      }
14402da26cSstephan    </style>
15402da26cSstephan  </head>
16402da26cSstephan  <body>
17402da26cSstephan    <h1>sqlite3 WASM/JS tester #1 (Worker thread)</h1>
18d85d0839Sstephan    <div id='test-output'></div>
19402da26cSstephan    <script>(function(){
20d85d0839Sstephan      const logTarget = document.querySelector('#test-output');
21402da26cSstephan      const logHtml = function(cssClass,...args){
22402da26cSstephan        const ln = document.createElement('div');
23402da26cSstephan        if(cssClass) ln.classList.add(cssClass);
24402da26cSstephan        ln.append(document.createTextNode(args.join(' ')));
25d85d0839Sstephan        logTarget.append(ln);
26402da26cSstephan      };
27*cd0df83cSstephan      const w = new Worker("tester1.js?sqlite3.dir=jswasm");
28402da26cSstephan      w.onmessage = function({data}){
29402da26cSstephan        switch(data.type){
30402da26cSstephan            case 'log':
31402da26cSstephan              logHtml(data.payload.cssClass, ...data.payload.args);
32402da26cSstephan              break;
33402da26cSstephan            default:
34402da26cSstephan              logHtml('error',"Unhandled message:",data.type);
35402da26cSstephan        };
36402da26cSstephan      };
37402da26cSstephan    })();</script>
38402da26cSstephan  </body>
39402da26cSstephan</html>
40