XrDeviceTestRule


public final class XrDeviceTestRule extends ExternalResource


JUnit Rule containing properties that affect the results of XrDevice capability APIs.

Summary

Public constructors

Public methods

final @NonNull DisplayBlendMode

The result of XrDevice.getPreferredDisplayBlendMode.

final int

The value to be returned by SpatialApiVersionHelper.spatialApiVersion.

final @NonNull Set<@NonNull DepthEstimationMode>

The set of DepthEstimationMode instances supported by the XrDevice.

final @NonNull Set<@NonNull EyeTrackingMode>

The set of EyeTrackingMode instances supported by the XrDevice.

final @NonNull Set<@NonNull GeospatialMode>

The set of GeospatialMode instances supported by the XrDevice.

final @NonNull Set<@NonNull HandTrackingMode>

The set of HandTrackingMode instances supported by the XrDevice.

final @NonNull Set<@NonNull RenderingMode>

The set of RenderingMode instances supported by the XrDevice.

final boolean

This property can be used to control whether the Projected service is available or not.

final void

The result of XrDevice.getPreferredDisplayBlendMode.

final void

This property can be used to control whether the Projected service is available or not.

final void

The value to be returned by SpatialApiVersionHelper.spatialApiVersion.

final void

The set of DepthEstimationMode instances supported by the XrDevice.

final void

The set of EyeTrackingMode instances supported by the XrDevice.

final void

The set of GeospatialMode instances supported by the XrDevice.

final void

The set of HandTrackingMode instances supported by the XrDevice.

final void

The set of RenderingMode instances supported by the XrDevice.

Protected methods

void
void

Inherited methods

From org.junit.rules.TestRule

Public constructors

XrDeviceTestRule

Added in 1.0.0-alpha15
public XrDeviceTestRule()

Public methods

getPreferredDisplayBlendMode

Added in 1.0.0-alpha15
public final @NonNull DisplayBlendMode getPreferredDisplayBlendMode()

The result of XrDevice.getPreferredDisplayBlendMode.

Tests can set this property to control the value returned by XrDevice.getPreferredDisplayBlendMode during the test execution.

getSpatialApiVersion

Added in 1.0.0-alpha15
public final int getSpatialApiVersion()

The value to be returned by SpatialApiVersionHelper.spatialApiVersion.

Tests can set this property to control the value returned by SpatialApiVersionHelper.spatialApiVersion during the test execution. By default the value is set to the latest stable API level.

getSupportedDepthEstimationModes

Added in 1.0.0-alpha15
public final @NonNull Set<@NonNull DepthEstimationModegetSupportedDepthEstimationModes()

The set of DepthEstimationMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isDepthEstimationModeSupported during the test execution.

getSupportedEyeTrackingModes

Added in 1.0.0-alpha15
public final @NonNull Set<@NonNull EyeTrackingModegetSupportedEyeTrackingModes()

The set of EyeTrackingMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isEyeTrackingModeSupported during the test execution.

getSupportedGeospatialModes

Added in 1.0.0-alpha15
public final @NonNull Set<@NonNull GeospatialModegetSupportedGeospatialModes()

The set of GeospatialMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isGeospatialModeSupported during the test execution.

getSupportedHandTrackingModes

Added in 1.0.0-alpha15
public final @NonNull Set<@NonNull HandTrackingModegetSupportedHandTrackingModes()

The set of HandTrackingMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isHandTrackingModeSupported during the test execution.

getSupportedRenderingModes

Added in 1.0.0-alpha15
public final @NonNull Set<@NonNull RenderingModegetSupportedRenderingModes()

The set of RenderingMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isRenderingModeSupported during the test execution.

isProjectedServiceAvailable

Added in 1.0.0-alpha15
public final boolean isProjectedServiceAvailable()

This property can be used to control whether the Projected service is available or not. By default, the Projected service is available.

setPreferredDisplayBlendMode

Added in 1.0.0-alpha15
public final void setPreferredDisplayBlendMode(@NonNull DisplayBlendMode value)

The result of XrDevice.getPreferredDisplayBlendMode.

Tests can set this property to control the value returned by XrDevice.getPreferredDisplayBlendMode during the test execution.

setProjectedServiceAvailable

Added in 1.0.0-alpha15
public final void setProjectedServiceAvailable(boolean value)

This property can be used to control whether the Projected service is available or not. By default, the Projected service is available.

setSpatialApiVersion

Added in 1.0.0-alpha15
public final void setSpatialApiVersion(int value)

The value to be returned by SpatialApiVersionHelper.spatialApiVersion.

Tests can set this property to control the value returned by SpatialApiVersionHelper.spatialApiVersion during the test execution. By default the value is set to the latest stable API level.

setSupportedDepthEstimationModes

Added in 1.0.0-alpha15
public final void setSupportedDepthEstimationModes(
    @NonNull Set<@NonNull DepthEstimationMode> value
)

The set of DepthEstimationMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isDepthEstimationModeSupported during the test execution.

setSupportedEyeTrackingModes

Added in 1.0.0-alpha15
public final void setSupportedEyeTrackingModes(@NonNull Set<@NonNull EyeTrackingMode> value)

The set of EyeTrackingMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isEyeTrackingModeSupported during the test execution.

setSupportedGeospatialModes

Added in 1.0.0-alpha15
public final void setSupportedGeospatialModes(@NonNull Set<@NonNull GeospatialMode> value)

The set of GeospatialMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isGeospatialModeSupported during the test execution.

setSupportedHandTrackingModes

Added in 1.0.0-alpha15
public final void setSupportedHandTrackingModes(
    @NonNull Set<@NonNull HandTrackingMode> value
)

The set of HandTrackingMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isHandTrackingModeSupported during the test execution.

setSupportedRenderingModes

Added in 1.0.0-alpha15
public final void setSupportedRenderingModes(@NonNull Set<@NonNull RenderingMode> value)

The set of RenderingMode instances supported by the XrDevice.

Tests can modify this set to control the value returned by XrDevice.isRenderingModeSupported during the test execution.

Protected methods

after

protected void after()

before

Added in 1.0.0-alpha15
protected void before()