mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 21:21:17 +01:00
Set up http and websocket servers in deploy_tests.py that allow us to communicate with the remote wasm app similarly to how we communicate with android & ios devices. Add a "-w" target to check_golds.sh that kicks tests off in the default browser. Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
24 lines
761 B
HTML
24 lines
761 B
HTML
<canvas id="canvas"></canvas>
|
|
<script>
|
|
window.onhashchange = function() { location.reload(); }
|
|
function printMessageOnServer(text) {
|
|
const lengthBytes = lengthBytesUTF8(text) + 1;
|
|
const stringOnWasmHeap = Module['_malloc'](lengthBytes);
|
|
stringToUTF8(text, stringOnWasmHeap, lengthBytes);
|
|
Module['_rive_print_message_on_server'](stringOnWasmHeap);
|
|
Module['_free'](stringOnWasmHeap);
|
|
}
|
|
var Module = {
|
|
'canvas': document.getElementById("canvas"),
|
|
'print': function(text) {
|
|
printMessageOnServer(text + '\n');
|
|
console.log(text);
|
|
},
|
|
'printErr': function(text) {
|
|
printMessageOnServer(text + '\n');
|
|
console.error(text);
|
|
},
|
|
};
|
|
</script>
|
|
<script src="gms.js"></script>
|