aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_android_cast.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_android_cast.py')
-rw-r--r--packages/meshbay-hub/tests/test_android_cast.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/packages/meshbay-hub/tests/test_android_cast.py b/packages/meshbay-hub/tests/test_android_cast.py
index 0ff383a..a346d15 100644
--- a/packages/meshbay-hub/tests/test_android_cast.py
+++ b/packages/meshbay-hub/tests/test_android_cast.py
@@ -53,7 +53,6 @@ def test_the_relay_keeps_the_desktop_mitigations():
for name in ("RING_CAP", "PORT_BASE", "PORT_COUNT"):
js = re.search(rf"const {name} = (\d+);", desktop).group(1)
assert re.search(rf"const val {name} = {js}\b", relay), name
- assert "BACKPRESSURE_HIGH = 8L * 1024 * 1024" in relay
assert "InetSocketAddress(address, PORT_BASE + i)" in relay, "bound to the LAN address"
# Code, not comments: the comment saying "never 0.0.0.0" is not a bind.
code = re.sub(r"/\*.*?\*/", "", relay, flags=re.S)
@@ -65,6 +64,21 @@ def test_the_relay_keeps_the_desktop_mitigations():
assert serve.index('method == "OPTIONS"') < serve.index('query["t"] != token')
+def test_what_a_receiver_has_not_read_waits_on_disk():
+ """The desktop drops a fragment once 8 MB wait for a receiver; a fragment
+ is 5 to 10 MB at a film's bitrate, so the television froze for its length
+ (measured: three dropped in the first fifteen seconds). Here the lead waits
+ in a spool file per receiver, deleted with it, and is dropped only past a
+ disk bound."""
+ relay = _read(CAST / "CastRelay.kt")
+ assert "BACKPRESSURE_HIGH" not in relay
+ assert "RandomAccessFile(file, \"rw\").channel" in relay
+ assert "c.waiting() > spoolLimit()" in relay
+ assert "SPOOL_MAX_BYTES = 2L * 1024 * 1024 * 1024" in relay
+ assert "file.delete()" in relay
+ assert 'java.io.File(context.cacheDir, "cast-relay")' in _read(CAST / "CastChannels.kt")
+
+
def test_the_backlog_is_bounded_in_bytes():
"""A fragment is a segment, megabytes at a film's bitrate: 64 of them killed
the application with an OutOfMemoryError on the emulator."""