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 Lifecycle.State |
Tests can set this property to control the lifecycle state of the |
final @NonNull DisplayBlendMode |
The result of |
final int |
The value to be returned by |
final @NonNull Set<@NonNull DepthEstimationMode> |
The set of |
final @NonNull Set<@NonNull EyeTrackingMode> |
The set of |
final @NonNull Set<@NonNull GeospatialMode> |
The set of |
final @NonNull Set<@NonNull HandTrackingMode> |
The set of |
final @NonNull Set<@NonNull RenderingMode> |
The set of |
final boolean |
This property can be used to control whether the Projected service is available or not. |
final void |
setLifecycleState(@NonNull Lifecycle.State value)Tests can set this property to control the lifecycle state of the |
final void |
The result of |
final void |
setProjectedServiceAvailable(boolean value)This property can be used to control whether the Projected service is available or not. |
final void |
setSpatialApiVersion(int value)The value to be returned by |
final void |
The set of |
final void |
The set of |
final void |
The set of |
final void |
The set of |
final void |
setSupportedRenderingModes(@NonNull Set<@NonNull RenderingMode> value)The set of |
Inherited methods |
|---|
Public constructors
Public methods
getLifecycleState
public final @NonNull Lifecycle.State getLifecycleState()
Tests can set this property to control the lifecycle state of the XrDevice. By default, the value is set to Lifecycle.State.INITIALIZED.
getPreferredDisplayBlendMode
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
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
public final @NonNull Set<@NonNull DepthEstimationMode> getSupportedDepthEstimationModes()
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
public final @NonNull Set<@NonNull EyeTrackingMode> getSupportedEyeTrackingModes()
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
public final @NonNull Set<@NonNull GeospatialMode> getSupportedGeospatialModes()
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
public final @NonNull Set<@NonNull HandTrackingMode> getSupportedHandTrackingModes()
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
public final @NonNull Set<@NonNull RenderingMode> getSupportedRenderingModes()
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
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.
setLifecycleState
public final void setLifecycleState(@NonNull Lifecycle.State value)
Tests can set this property to control the lifecycle state of the XrDevice. By default, the value is set to Lifecycle.State.INITIALIZED.
setPreferredDisplayBlendMode
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
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
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
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
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
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
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
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.