Replace leaf entry with persistent horizontal toolbar and shared panel state
This commit is contained in:
1 parent
d2501d0112
commit
19361fd1cc
18 files changed
+1010
-454
No files matched your search
@@ -109,3 +109,31 @@ def test_ui_update_starts_persistent_application_after_successful_smoke(qtbot, t
|
||||
("smoke", (executable, "ui", "--smoke-test-ms", "1000")),
|
||||
("launch", (executable, "ui")),
|
||||
]
|
||||
|
||||
|
||||
def test_update_handoff_exits_both_windows_and_shutdowns_controllers(qtbot, tmp_path, monkeypatch):
|
||||
from types import SimpleNamespace
|
||||
from PySide6.QtCore import QTimer
|
||||
window, controller, manifest, commands = _launch_fixture(qtbot, tmp_path, monkeypatch)
|
||||
current = _portable(tmp_path, 'portable-exit')
|
||||
monkeypatch.setattr(sys, 'executable', str(current / 'DxDesignerTools.exe'))
|
||||
shutdowns = []
|
||||
window.settings_controller = SimpleNamespace(shutdown=lambda: shutdowns.append('settings'))
|
||||
timer = QTimer(window)
|
||||
timer.start(100)
|
||||
window.show_panel(0)
|
||||
with qtbot.waitSignal(window.window_closed):
|
||||
app_module._launch_update(window, controller, manifest)
|
||||
assert commands and shutdowns == ['settings']
|
||||
assert window._closing and not window.isVisible() and not window.toolbar.isVisible()
|
||||
assert not timer.isActive()
|
||||
|
||||
|
||||
def test_update_does_not_spawn_updater_while_menu_registration_is_running(qtbot, tmp_path, monkeypatch):
|
||||
from types import SimpleNamespace
|
||||
window, controller, manifest, commands = _launch_fixture(qtbot, tmp_path, monkeypatch)
|
||||
window.startup_controller = SimpleNamespace(is_running=lambda: True)
|
||||
app_module._launch_update(window, controller, manifest)
|
||||
assert not commands and not window._closing
|
||||
assert '菜单注册' in window.operation_status.text()
|
||||
window.startup_controller = None
|
||||
Reference in new issue
Block a user