When a MockXRDeviceHookBase is constructed, it sets itself as the current test hook in XRServiceTestHook::SetTestHook(). This then causes the provided test hook to be set as the current hook for each runtime. What specifically each runtime does after that differs (covered in each runtime's specific section), but the important part is that the runtimes will start calling into the test via Mojo to get controller and headset data instead of attempting to use the real implementation.