fix(wifi-adb): force openscreen mdns backend for scan discovery

This commit is contained in:
Your Name committed 2026-06-01 09:49:32 +08:00
1 parent f76232f2fc
commit e33b42597c
2 files changed
+21

No files matched your search

+15
View File
@@ -276,6 +276,21 @@ garbage line
assert scan.discover_mdns_targets("/adb") == []
class TestRunAdbEnv:
def test_sets_openscreen_mdns_by_default(self):
called = {}
def fake_run(*args, **kwargs):
called["env"] = kwargs.get("env", {})
return _proc("", "", 0)
with patch("subprocess.run", side_effect=fake_run):
scan._run_adb("/adb", ["mdns", "services"])
env = called.get("env", {})
assert env.get("ADB_MDNS_OPENSCREEN") == "1"
# ============================================================
# discover_adb_devices —— 主入口集成测试
# ============================================================