aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests')
-rw-r--r--packages/meshbay-hub/tests/test_android_cast.py10
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