# 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)

*** ** * ** ***


```
class SceneTester
```

<br />

*** ** * ** ***

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

## Summary

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SceneTester#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SceneTester#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SceneTester#triggerSpaceChanged(androidx.xr.scenecore.SpaceChangeEvent)(spaceChangeEvent: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpaceChangeEvent)` Simulates a runtime spatial mode change by dispatching the provided `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpaceChangeEvent` to the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Scene`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SceneTester#triggerSpatialVisibilityChanged(androidx.xr.scenecore.SpatialVisibility)(spatialVisibility: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialVisibility)` Invoking this function simulates a runtime visibility change. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/PanelClippingConfig` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SceneTester#panelClippingConfig()` The current clipping configuration of all panels in the `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/Scene`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpatialCapability>` | `https://developer.android.com/reference/kotlin/androidx/xr/scenecore/testing/SceneTester#spatialCapabilities()` Simulates the spatial capabilities of the `https://developer.android.com/reference/kotlin/androidx/xr/runtime/Session`. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### triggerSpaceChanged

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

```
fun triggerSpaceChanged(spaceChangeEvent: SpaceChangeEvent): Unit
```

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

This will trigger the custom listener registered via `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/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 |
|---|---|
| `spaceChangeEvent: https://developer.android.com/reference/kotlin/androidx/xr/scenecore/SpaceChangeEvent` | The simulated `https://developer.android.com/reference/kotlin/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)

```
fun triggerSpatialVisibilityChanged(spatialVisibility: SpatialVisibility): Unit
```

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/kotlin/androidx/xr/scenecore/Scene#addSpatialVisibilityChangedListener(java.util.concurrent.Executor,java.util.function.Consumer)`.

## Public properties

### panelClippingConfig

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

```
val panelClippingConfig: PanelClippingConfig
```

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

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

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

### spatialCapabilities

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

```
var spatialCapabilities: Set<SpatialCapability>
```

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

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