XRTest API

interface XRTest {
  // Simulates connecting a device to the system.
  // Used to instantiate a fake device for use in tests.
  Promise<FakeXRDeviceController> simulateDeviceConnection(FakeXRDeviceInit);

  // Simulates a device being disconnected from the system.
  Promise<void> simulateDeviceDisconnection(XRDevice);

  // Simulates a user activation (aka user gesture) for the current scope.
  // The activation is only guaranteed to be valid in the provided function and only applies to WebXR
  // Device API methods.
  void simulateUserActivation(Function);
};

dictionary FakeXRDeviceInit {
        // TODO: Subject to change to match spec changes.
        required boolean supportsImmersive;
}

interface FakeXRDeviceController {
  // Creates and attaches a XRFrameOfReference of the type specified to the device. 
  void setFrameOfReference(XRFrameOfReferenceType,  FakeXRFrameOfReferenceInit);

  // Sets the values to be used for subsequent
  // requestAnimationFrame() callbacks.
  void setViews(Array<FakeXRViewInit> views);

  void setViewerOrigin(FakeXRRigidTransform origin);

  // Simulates the user activating the reset pose on a device.
  void simulateResetPose();

  // Simulates the platform ending the sessions.
  void simulateForcedEndSessions();

  // Simulates devices focusing and blurring sessions.
  void simulateBlurSession(XRSession);
  void simulateFocusSession(XRSession);

  void setBoundsGeometry(Array<FakeXRBoundsPoint> boundsCoodinates)l
  
  Promise<FakeXRInputSourceController>  
      simulateInputSourceConnection(FakeXRInputSourceInit);
}

dictionary FakeXRViewInit {
  required XREye eye;