11cb0ef41Sopenharmony_ci<!DOCTYPE html> 21cb0ef41Sopenharmony_ci<title>Check execution of WebAssembly start function</title> 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ci<script src="/resources/testharness.js"></script> 51cb0ef41Sopenharmony_ci<script src="/resources/testharnessreport.js"></script> 61cb0ef41Sopenharmony_ci<script> 71cb0ef41Sopenharmony_ci setup({allow_uncaught_exception: true}); 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci const test_load = async_test( 101cb0ef41Sopenharmony_ci "Importing a WebAssembly module should execute the start function."); 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci window.log = []; 131cb0ef41Sopenharmony_ci window.addEventListener("error", ev => { 141cb0ef41Sopenharmony_ci log.push(ev.message); 151cb0ef41Sopenharmony_ci }); 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ci window.addEventListener("load", test_load.step_func_done(ev => { 181cb0ef41Sopenharmony_ci assert_array_equals(log, ["executed"]); 191cb0ef41Sopenharmony_ci })); 201cb0ef41Sopenharmony_ci 211cb0ef41Sopenharmony_ci function unreachable() { log.push("unexpected"); } 221cb0ef41Sopenharmony_ci</script> 231cb0ef41Sopenharmony_ci<script type="module" src="./resources/execute-start.wasm" onerror="unreachable()""></script> 24