PlayerAdapterConformanceTest

Language-neutral PlayerAdapter conformance suite (Kotlin port of the web @dolby-optiview/ads-sdk-adapter-test-kit). Subclass it for a concrete adapter, provide createAdapter, and the inherited tests assert the shared contract every OptiView Ads PlayerAdapter must satisfy:

  • state properties (currentTime/duration/paused/muted/volume/programDateTime),

  • volume clamping to [0, 1] and mute pass-through,

  • subscription lifecycle (on/off, multiple handlers, idempotent destroy),

  • optional capabilities (preload, supportsParallelBuffering).

Event delivery is platform-dependent: it is only asserted when the platform can synthesize a player event headlessly (see triggerVolumeChange). On Android, ExoPlayer volume/playback events need real playback or a device, so delivery is covered by on-device integration; here it is skipped via Assume.

See also

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Create a fresh adapter wrapping a fresh underlying player.

A volumechange reaches a subscribed handler and stops after PlayerAdapter.off; skipped when triggerVolumeChange returns false.

Link copied to clipboard

Calling PlayerAdapter.destroy twice does not throw.

Link copied to clipboard

A fresh adapter reports position 0, an infinite duration and a paused player.

Link copied to clipboard

Setting PlayerAdapter.muted reads back the same value.

Link copied to clipboard

PlayerAdapter.preload of a URL does not throw.

Link copied to clipboard

PlayerAdapter.programDateTime is null before any stream is loaded.

Link copied to clipboard

Destroys the adapter created for the test; runs after every test.

Link copied to clipboard

Synthesize a volumechange on the adapter's underlying player so delivery can be asserted headlessly. Return false if the platform cannot trigger it without real playback/a device (the delivery test is then skipped).

Link copied to clipboard

PlayerAdapter.setVideoQuality with null returns false and does not throw.

Link copied to clipboard

Setting PlayerAdapter.volume reads back the same value, clamped to 0.0..1.0.