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

Function main

test/browser/test_html5_pointerlockerror.c:79–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79int main() {
80 printf("'pointerlockerror' event test:\n");
81 printf("Reject the pointer lock request after clicking on canvas.\n");
82
83 // Make the canvas area stand out from the background.
84 emscripten_set_canvas_element_size( "#canvas", 400, 300 );
85 EM_ASM(Module['canvas'].style.backgroundColor = 'black';);
86
87 EMSCRIPTEN_RESULT ret = emscripten_set_click_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, 0, 1, click_callback);
88 TEST_RESULT(emscripten_set_click_callback);
89 ret = emscripten_set_pointerlockchange_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, 0, 1, pointerlockchange_callback);
90 TEST_RESULT(emscripten_set_pointerlockchange_callback);
91 ret = emscripten_set_pointerlockerror_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, 0, 1, pointerlockerror_callback);
92 TEST_RESULT(emscripten_set_pointerlockerror_callback);
93
94 emscripten_exit_with_live_runtime();
95 return 0;
96}

Callers

nothing calls this directly

Calls 2

printfFunction · 0.85
EM_ASMFunction · 0.70

Tested by

no test coverage detected