Files
rive-cpp/tests/gm/gms.html
csmartdalton 6efab9c56f feat: Update goldens and player to deploy in the browser (#10453) 827077b899
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>
2025-08-27 02:58:49 +00:00

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>