diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_desktop_shell.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_desktop_shell.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_desktop_shell.py b/packages/meshbay-hub/tests/test_desktop_shell.py index 2e7ea82..5862ac3 100644 --- a/packages/meshbay-hub/tests/test_desktop_shell.py +++ b/packages/meshbay-hub/tests/test_desktop_shell.py @@ -536,3 +536,52 @@ def test_the_tray_is_created_at_launch(): assert bridge < launch, "ensureTray must come after registerBridge" assert launch < window, "the tray is created as part of startup" + + +# ── Chromium's command line ───────────────────────────────────────────────── + +def test_no_feature_list_is_ever_written_directly(): + """ + `--enable-features` and `--disable-features` are one comma-joined list + each, and `appendSwitch` **replaces** the value rather than appending to + it. A second direct call therefore cancels the first with no error and + nothing in a log — the symptom is a feature that is simply not on, which + is how the mDNS switch below and the VA-API switches could silently + cancel each other. Every caller goes through `addFeatures`, which merges. + """ + direct = re.findall(r"appendSwitch\(\s*['\"](?:enable|disable)-features", + _main()) + assert not direct, ( + "a feature list is being written with appendSwitch directly; it " + "overwrites whatever another line already put there — use addFeatures") + + +def test_the_mdns_concealment_is_still_disabled(): + """Chromium's `.local` host candidates are dropped by aiortc, which has no + mDNS resolver: concealing the local IP removes the only LAN-routable + candidate rather than degrading it.""" + assert "addFeatures('disable-features', ['WebRtcHideLocalIpsWithMdns'])" in _main() + + +def test_hardware_video_decoding_is_asked_for_and_then_verified(): + """ + Turning VA-API on is half the job. Chromium renames these features across + releases and the client is rebuilt against the newest Electron every time, + so a name that stops matching must not pass for a feature that is on: the + result is measured through `navigator.mediaCapabilities` and remembered, + and `--ignore-gpu-blocklist` is dropped again on a machine where the + measurement never says hardware. + """ + main = _main() + for feature in ("VaapiVideoDecodeLinuxGL", "AcceleratedVideoDecodeLinuxGL"): + assert feature in main, f"{feature} is no longer requested" + assert "ignore-gpu-blocklist" in main + assert "mediaCapabilities" in main and "powerEfficient" in main, ( + "the switches are applied but nothing checks whether they worked") + + +def test_hardware_decoding_can_be_turned_off_without_a_rebuild(): + """A machine whose GL stack misbehaves in a way the measurement does not + catch needs an answer that is not "reinstall": config.json, the same file + every other client setting lives in.""" + assert "config.videoAcceleration" in _main() |