# SceneTester

Artifact: [androidx.xr.scenecore:scenecore-testing](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/testing/SceneTester.kt+class:androidx.xr.scenecore.testing.SceneTester) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
public final class SceneTester
```

<br />

*** ** * ** ***

A test utility for accessing and inspecting the data associated with the `https://developer.android.com/reference/androidx/xr/scenecore/Scene`.

## Summary

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SceneTester#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/PanelClippingConfig` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SceneTester#getPanelClippingConfig()()` The current clipping configuration of all panels in the `https://developer.android.com/reference/androidx/xr/scenecore/Scene`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SpatialCapability>` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SceneTester#getSpatialCapabilities()()` Simulates the spatial capabilities of the `https://developer.android.com/reference/androidx/xr/runtime/Session`. |
| `int` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SceneTester#hashCode()()` |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SceneTester#setSpatialCapabilities(kotlin.collections.Set)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SpatialCapability> value)` Simulates the spatial capabilities of the `https://developer.android.com/reference/androidx/xr/runtime/Session`. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SceneTester#triggerSpaceChanged(androidx.xr.scenecore.SpaceChangeEvent)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SpaceChangeEvent spaceChangeEvent)` Simulates a runtime spatial mode change by dispatching the provided `https://developer.android.com/reference/androidx/xr/scenecore/SpaceChangeEvent` to the `https://developer.android.com/reference/androidx/xr/scenecore/Scene`. |
| `final void` | `https://developer.android.com/reference/androidx/xr/scenecore/testing/SceneTester#triggerSpatialVisibilityChanged(androidx.xr.scenecore.SpatialVisibility)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SpatialVisibility spatialVisibility )` Invoking this function simulates a runtime visibility change. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getPanelClippingConfig

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull PanelClippingConfig getPanelClippingConfig()
```

The current clipping configuration of all panels in the `https://developer.android.com/reference/androidx/xr/scenecore/Scene`.

This property reflects the result of setting the `https://developer.android.com/reference/androidx/xr/scenecore/Scene#panelClippingConfig()` value.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/PanelClippingConfig` |   |

### getSpatialCapabilities

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull Set<@NonNull SpatialCapability> getSpatialCapabilities()
```

Simulates the spatial capabilities of the `https://developer.android.com/reference/androidx/xr/runtime/Session`.

This property's value changes in response to calls to `https://developer.android.com/reference/androidx/xr/scenecore/Scene#requestFullSpaceMode()` and `https://developer.android.com/reference/androidx/xr/scenecore/Scene#requestHomeSpaceMode()`. Any listeners registered via `https://developer.android.com/reference/androidx/xr/scenecore/Scene#addSpatialCapabilitiesChangedListener(java.util.function.Consumer)` are triggered upon a change in this value.

### hashCode

```
public int hashCode()
```

### setSpatialCapabilities

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final void setSpatialCapabilities(@NonNull Set<@NonNull SpatialCapability> value)
```

Simulates the spatial capabilities of the `https://developer.android.com/reference/androidx/xr/runtime/Session`.

This property's value changes in response to calls to `https://developer.android.com/reference/androidx/xr/scenecore/Scene#requestFullSpaceMode()` and `https://developer.android.com/reference/androidx/xr/scenecore/Scene#requestHomeSpaceMode()`. Any listeners registered via `https://developer.android.com/reference/androidx/xr/scenecore/Scene#addSpatialCapabilitiesChangedListener(java.util.function.Consumer)` are triggered upon a change in this value.

### triggerSpaceChanged

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final void triggerSpaceChanged(@NonNull SpaceChangeEvent spaceChangeEvent)
```

Simulates a runtime spatial mode change by dispatching the provided `https://developer.android.com/reference/androidx/xr/scenecore/SpaceChangeEvent` to the `https://developer.android.com/reference/androidx/xr/scenecore/Scene`.

This will trigger the custom listener registered via `https://developer.android.com/reference/androidx/xr/scenecore/Scene#setSpaceChangedListener(java.util.concurrent.Executor,java.util.function.Consumer)`. If no custom listener is registered, or if it has been cleared via `https://developer.android.com/reference/androidx/xr/scenecore/Scene#clearSpaceChangedListener()`, this invokes the default internal listener which automatically applies the recommended pose and scale from the event to the `https://developer.android.com/reference/androidx/xr/scenecore/Scene#keyEntity()`.

Note: The listener is executed asynchronously on the `https://developer.android.com/reference/java/util/concurrent/Executor.html` configured for the listener (defaults to the main thread).

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/SpaceChangeEvent spaceChangeEvent` | The simulated `https://developer.android.com/reference/androidx/xr/scenecore/SpaceChangeEvent` containing the recommended pose and scale to dispatch. |

### triggerSpatialVisibilityChanged

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final void triggerSpatialVisibilityChanged(
    @NonNull SpatialVisibility spatialVisibility
)
```

Invoking this function simulates a runtime visibility change. This is useful for testing how the application handles transitions between different visibility states (e.g., releasing resources when HIDDEN).

Invoking this function will trigger any listeners registered via `https://developer.android.com/reference/androidx/xr/scenecore/Scene#addSpatialVisibilityChangedListener(java.util.concurrent.Executor,java.util.function.Consumer)`.