-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwasm-test.html
More file actions
48 lines (38 loc) · 1.48 KB
/
wasm-test.html
File metadata and controls
48 lines (38 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
<head>
<title>WebAssembly Test</title>
</head>
<body>
<h1>WebAssembly Loading Test</h1>
<div id="output"></div>
<script type="module">
const output = document.getElementById('output');
function log(message) {
console.log(message);
output.innerHTML += message + '<br>';
}
async function testWebAssembly() {
try {
log('Starting WebAssembly test...');
// Import the WebAssembly module
const wasmModule = await import('./src/wasm-production/zhtp_core.js');
log(' WebAssembly module imported successfully');
// Initialize WebAssembly
await wasmModule.default();
log(' WebAssembly module initialized');
// Test basic functionality
const version = wasmModule.get_production_version();
log(' Version: ' + version);
const capabilities = wasmModule.get_production_capabilities();
log(' Capabilities: ' + JSON.stringify(capabilities));
log(' All tests passed!');
} catch (error) {
log('❌ Error: ' + error.message);
console.error('Full error:', error);
}
}
testWebAssembly();
</script>
</body>
</html>