Do not delay a browser restart without a screen; clearer reload error
Without a connected monitor every Chromium start waited 30 s for one, so DevTools was unreachable for ~35 s after a restart. Only wait right after boot. The reload error now says Chromium may still be starting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b790f57531
commit
7e07428a81
3 files changed
+30
-5
No files matched your search
@@ -78,3 +78,17 @@ def test_local_pages_exist():
|
||||
www = Path(__file__).resolve().parents[1] / "www"
|
||||
for page in ("start.html", "offline.html", "setup.html", "kiosk.css", "logo.svg"):
|
||||
assert (www / page).exists()
|
||||
|
||||
|
||||
def test_prepare_display_waits_for_a_screen_only_after_boot(paths, monkeypatch):
|
||||
calls = []
|
||||
monkeypatch.setattr(b, "_run", lambda args: calls.append(args) or None)
|
||||
monkeypatch.setattr(b.time, "sleep", lambda s: None)
|
||||
monkeypatch.setattr(b.sysinfo, "uptime_seconds", lambda: 3600.0)
|
||||
assert b.prepare_display(paths, dict(DEFAULTS)) is None
|
||||
assert sum(c == ["xrandr", "--query"] for c in calls) == 1
|
||||
|
||||
calls.clear()
|
||||
monkeypatch.setattr(b.sysinfo, "uptime_seconds", lambda: 40.0)
|
||||
b.prepare_display(paths, dict(DEFAULTS))
|
||||
assert sum(c == ["xrandr", "--query"] for c in calls) == 15
|
||||
Reference in new issue
Block a user