MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / EM_ASM

Function EM_ASM

test/browser/async_iostream.cpp:25–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 static int counter = 0;
24 counter++;
25 EM_ASM(
26 function sendEvent(type, data) {
27 setTimeout(function() {
28 var event = document.createEvent('Event');
29 event.initEvent(type, true, true);
30 for(var d in data) event[d] = data[d];
31 Module['canvas'].dispatchEvent(event);
32 }, Math.random()*100);
33 }
34 sendEvent('mousedown', { screenX: 1, screenY: 1, clientX: 1, clientY: 1, button: 0, buttons: 1 });
35 );
36 cout << "sent event " << counter << "\n";
37 if (seen >= 10) {
38 emscripten_cancel_main_loop();
39 cout << "Success.\n";
40 REPORT_RESULT(1);
41 return;
42 }
43 if (counter >= 100) {
44 emscripten_cancel_main_loop();
45 cout << "FAIL\n";
46 REPORT_RESULT(9999);
47 return;
48 }
49}
50
51int main() {
52 cout << "HelloWorld" << endl;

Callers 15

test_html5_mouse.cFile · 0.70
mainFunction · 0.70
glut_draw_callbackFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
mainFunction · 0.70
ReadMethod · 0.70
mainFunction · 0.70
readyFunction · 0.70
mainFunction · 0.70

Calls 1

sendEventFunction · 0.70

Tested by 15

mainFunction · 0.56
glut_draw_callbackFunction · 0.56
mainFunction · 0.56
mainFunction · 0.56
mainFunction · 0.56
mainFunction · 0.56
readyFunction · 0.56
mainFunction · 0.56
ThrowsOnConstructionMethod · 0.56
readyFunction · 0.56
mainFunction · 0.56
mainFunction · 0.56