Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input mocking, input sources change event #25463

Merged
merged 15 commits into from Jan 9, 2020
Prev

Make next_input_id an InputId

  • Loading branch information
Manishearth committed Jan 9, 2020
commit 94e8ce5739677db8bd4c0ffbe50d035b37fafe51
@@ -37,15 +37,16 @@ pub struct FakeXRDevice {
reflector: Reflector,
#[ignore_malloc_size_of = "defined in ipc-channel"]
sender: IpcSender<MockDeviceMsg>,
next_input_id: Cell<u32>,
#[ignore_malloc_size_of = "defined in webxr-api"]
next_input_id: Cell<InputId>,
}

impl FakeXRDevice {
pub fn new_inherited(sender: IpcSender<MockDeviceMsg>) -> FakeXRDevice {
FakeXRDevice {
reflector: Reflector::new(),
sender,
next_input_id: Cell::new(0),
next_input_id: Cell::new(InputId(0)),
}
}

@@ -191,8 +192,7 @@ impl FakeXRDeviceMethods for FakeXRDevice {
init: &FakeXRInputSourceInit,
) -> Fallible<DomRoot<FakeXRInputController>> {
let id = self.next_input_id.get();
self.next_input_id.set(id + 1);
let id = InputId(id);
self.next_input_id.set(InputId(id.0 + 1));

let handedness = init.handedness.into();
let target_ray_mode = init.targetRayMode.into();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.