diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-10-04 22:46:00 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-10-04 22:46:00 +0200 |
| commit | 652465910dcdcc761aa2e078ff1a82625e2a0aa5 (patch) | |
| tree | 2378741f73ef0faaf138689ea366febef905e85c /packages/meshbay-hub/tests | |
| parent | 859d7ce71795dcfd5701cb08a684dcef23e7c4c0 (diff) | |
| download | meshbay-652465910dcdcc761aa2e078ff1a82625e2a0aa5.tar.gz | |
feat(android): music keeps playing with the screen off
While a track plays, the page asks the shell to stay awake
(playback:keep-alive): on Android the cast's foreground service and
visible WebView, with a notification; on desktop a power save blocker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests')
| -rw-r--r-- | packages/meshbay-hub/tests/test_android_cast.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/meshbay-hub/tests/test_android_cast.py b/packages/meshbay-hub/tests/test_android_cast.py index a346d15..bc5264e 100644 --- a/packages/meshbay-hub/tests/test_android_cast.py +++ b/packages/meshbay-hub/tests/test_android_cast.py @@ -111,11 +111,13 @@ def test_relay_calls_keep_their_order(): SRC / "bridge" / "Channels.kt") -def test_screen_off_survival_is_switched_on_only_while_casting(): +def test_screen_off_survival_is_switched_on_only_while_casting_or_playing(): activity = _read(SRC / "MainActivity.kt") - casting = activity.split("private fun casting(on: Boolean)", 1)[1].split("\n }", 1)[0] - assert "web.keepVisible = on" in casting - assert "startForegroundService(service) else stopService(service)" in casting + keep = activity.split("private fun keepAlive()", 1)[1].split("\n }\n", 1)[0] + assert "val on = casting || playing" in keep + assert "web.keepVisible = on" in keep + assert "if (!on) { stopService(service); return }" in keep + assert "startForegroundService(service)" in keep assert activity.count("keepVisible =") == 1, "the page is kept visible from one place only" view = _read(SRC / "shell" / "ShellWebView.kt") assert "var keepVisible = false" in view |