diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_downloads.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_downloads.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_downloads.py b/packages/meshbay-hub/tests/test_downloads.py index cc4fdd1..cd0cded 100644 --- a/packages/meshbay-hub/tests/test_downloads.py +++ b/packages/meshbay-hub/tests/test_downloads.py @@ -95,3 +95,16 @@ say(await M.freeName('clip.mp4', async n => n === 'clip.mp4')); def test_a_browser_without_the_api_reports_it(tmp_path): """`SUPPORTED` decides whether Settings offers a choice or an explanation.""" assert _run("say(M.SUPPORTED);", tmp_path) == [False] + + +def test_the_open_action_reads_the_file_back(tmp_path): + """ + "Open" is the browser being handed the bytes, not a desktop application + being started — no web page can do the second, and none can show a file + manager either. It is only offered for a file written into a granted folder, + since that is the one a page can read back. + """ + src = DOWNLOADS.read_text() + target = src[src.index("export async function openTarget"):] + assert "getFile()" in target and "window.open(" in target + assert "revokeObjectURL" in target, "the blob URL must not be leaked" |