feat(android): conformance on a device, and a start position for ExoPlayer

DR-247. The desktop suite cannot reach ExoPlayer: it needs an Android Context
and a Looper, so it exists only inside an app process. These are the same
behaviours, asserted against the engine itself.

Writing them forced the same gap open that mpv had. JellyTauPlayer.load(url,
mediaId) had no way to express a start position, so every caller loaded and
then seeked — the test could not even be written against the old signature,
which is a stronger statement than a failing assertion. The position now goes
to ExoPlayer with the media item via setMediaItem(item, startPositionMs), and
the two-argument form delegates to it, so nothing else had to change.

Running one suite against both engines settled something guesswork could not:

  seekWhileOpeningIsHonoured  passes on ExoPlayer with no fix

ExoPlayer already queues a seek issued before prepare() completes. So the
lost-seek half of DR-241 was mpv-specific, and only the missing vocabulary for
a start position was shared. That is the difference between "both engines have
this bug" and knowing which one does.

All seven cases pass on device (ROD2-W09, arm64).

The fixture is a silent WAV synthesised in the cache directory at setup rather
than committed or pushed: no binary in the repo, no adb step, and an exact
duration, which the seek assertions depend on.

Also adds the instrumentation runner to defaultConfig and teaches
sync-android-sources.sh to mirror src/androidTest, the way it already mirrors
src/test — so the canonical tree stays the only place tests are edited.

Run: ./gradlew :app:connectedUniversalDebugAndroidTest -x :app:rustBuildUniversalDebug
This commit is contained in:
2026-08-22 21:32:59 +02:00
parent 8904acb5f7
commit 20e683d705
5 changed files with 292 additions and 1 deletions
+13
View File
@@ -36,6 +36,19 @@ if [ -d "$TEST_SOURCE_DIR" ]; then
echo " Copied unit tests: src/test"
fi
# Instrumented tests (src/androidTest). These need a device: they drive
# ExoPlayer, which requires an Android Context and a Looper and therefore
# cannot run from the desktop conformance suite. Run with
# `./gradlew :app:connectedDebugAndroidTest` from gen/android.
ANDROID_TEST_SOURCE_DIR="$PROJECT_ROOT/src-tauri/android/src/androidTest/java/com/dtourolle/jellytau"
ANDROID_TEST_TARGET_DIR="$PROJECT_ROOT/src-tauri/gen/android/app/src/androidTest/java/com/dtourolle/jellytau"
if [ -d "$ANDROID_TEST_SOURCE_DIR" ]; then
rm -rf "$ANDROID_TEST_TARGET_DIR"
mkdir -p "$ANDROID_TEST_TARGET_DIR"
cp -r "$ANDROID_TEST_SOURCE_DIR"/. "$ANDROID_TEST_TARGET_DIR/"
echo " Copied instrumented tests: src/androidTest"
fi
# Copy individual Kotlin files (like VideoOverlayManager.kt)
for kt_file in "$SOURCE_DIR"/*.kt; do
if [ -f "$kt_file" ]; then