summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_streamed_download_reliability.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_streamed_download_reliability.py')
-rw-r--r--packages/meshbay-hub/tests/test_streamed_download_reliability.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_streamed_download_reliability.py b/packages/meshbay-hub/tests/test_streamed_download_reliability.py
index 355fbff..da745d0 100644
--- a/packages/meshbay-hub/tests/test_streamed_download_reliability.py
+++ b/packages/meshbay-hub/tests/test_streamed_download_reliability.py
@@ -501,3 +501,22 @@ def test_a_download_waits_for_the_self_test(tmp_path):
""")
assert out["target"] is True
assert out["ms"] >= 1, "the download did not wait for priming at all"
+
+
+def test_the_streamed_target_says_it_cannot_be_paused(tmp_path):
+ """The value the widget's pause button is drawn from, read off the real
+ module rather than a stub of it.
+
+ It is false for a reason that is not about this code: the browser is already
+ writing an HTTP response into its own download folder, so not feeding the
+ stream stalls a download we can neither see nor resume, and an idle worker
+ is terminated within seconds. Firefox and Safari therefore get cancel and no
+ pause; Chrome gets one as soon as a download folder has been granted, which
+ yields a held-open file instead of this.
+ """
+ out = _run(tmp_path, """
+ const target = await M.openStreamedDownload('film.mkv', 20e9, FAST);
+ out.pausable = target && target.pausable;
+ if (target) await target.writable.close();
+ """)
+ assert out["pausable"] is False