@@ -57,6 +57,35 @@ def _make_presentation(
5757 )
5858
5959
60+ def test_constructor_initializes_detail_controls (qapp ) -> None :
61+ location_search = SimpleNamespace (
62+ suggestionsReady = Mock (connect = Mock ()),
63+ searchFailed = Mock (connect = Mock ()),
64+ )
65+ arguments = [Mock () for _ in range (18 )]
66+
67+ with patch .object (PlaybackCoordinator , "_connect_signals" ), patch .object (
68+ PlaybackCoordinator ,
69+ "_setup_zoom_handler" ,
70+ ) as setup_zoom , patch .object (
71+ PlaybackCoordinator ,
72+ "_restore_filmstrip_preference" ,
73+ ) as restore_filmstrip , patch .object (
74+ playback_coordinator_module ,
75+ "LocationSearchController" ,
76+ return_value = location_search ,
77+ ):
78+ coordinator = PlaybackCoordinator (
79+ * arguments ,
80+ people_service = Mock (),
81+ pet_service = Mock (),
82+ )
83+
84+ setup_zoom .assert_called_once_with ()
85+ restore_filmstrip .assert_called_once_with ()
86+ coordinator .shutdown = Mock ()
87+
88+
6089def test_play_asset_dispatches_immediately_when_idle () -> None :
6190 coordinator = PlaybackCoordinator .__new__ (PlaybackCoordinator )
6291 coordinator ._asset_model = Mock (rowCount = Mock (return_value = 3 ))
@@ -414,6 +443,60 @@ def test_render_presentation_stops_video_area_before_showing_still() -> None:
414443 coordinator ._player_bar .setEnabled .assert_called_once_with (False )
415444
416445
446+ def test_render_live_presentation_keeps_motion_playback_active (tmp_path : Path ) -> None :
447+ still = tmp_path / "photo.heic"
448+ motion = tmp_path / "motion.mov"
449+ still .write_bytes (b"still" )
450+ motion .write_bytes (b"motion" )
451+ presentation = replace (
452+ _make_presentation (path = str (still ), is_video = False , is_live = True ),
453+ live_motion_rel = Path ("motion.mov" ),
454+ live_motion_abs = motion ,
455+ )
456+ coordinator = PlaybackCoordinator .__new__ (PlaybackCoordinator )
457+ coordinator ._detail_render_lifecycle = DetailRenderCoordinator ()
458+ coordinator ._detail_generation = 0
459+ coordinator ._live_transaction = None
460+ coordinator ._active_async_token = None
461+ coordinator ._player_view = Mock (
462+ video_area = Mock (
463+ has_video = Mock (return_value = False ),
464+ load_video = Mock (),
465+ play = Mock (),
466+ ),
467+ image_viewer = Mock (reset_zoom = Mock ()),
468+ )
469+ coordinator ._favorite_button = Mock (setEnabled = Mock ())
470+ coordinator ._info_button = Mock (setEnabled = Mock ())
471+ coordinator ._share_button = Mock (setEnabled = Mock ())
472+ coordinator ._edit_button = Mock (setEnabled = Mock ())
473+ coordinator ._rotate_button = Mock (setEnabled = Mock ())
474+ coordinator ._update_favorite_icon = Mock ()
475+ coordinator ._zoom_slider = Mock (blockSignals = Mock (), setValue = Mock ())
476+ coordinator ._player_bar = Mock (
477+ setEnabled = Mock (),
478+ set_playback_state = Mock (),
479+ set_position = Mock (),
480+ )
481+ coordinator ._zoom_handler = Mock (set_viewer = Mock ())
482+ coordinator ._zoom_widget = Mock (show = Mock ())
483+ coordinator ._info_panel = None
484+ coordinator ._clear_play_profile = Mock ()
485+ coordinator ._hide_face_name_overlay = Mock ()
486+ coordinator ._is_playing = False
487+
488+ PlaybackCoordinator ._render_presentation (coordinator , presentation )
489+
490+ coordinator ._player_view .video_area .load_video .assert_called_once_with (
491+ motion ,
492+ adjustments = None ,
493+ trim_range_ms = None ,
494+ adjusted_preview = False ,
495+ )
496+ coordinator ._player_view .video_area .play .assert_called_once_with ()
497+ assert coordinator ._is_playing is True
498+
499+
417500def _live_lifecycle_coordinator (
418501 tmp_path : Path ,
419502) -> tuple [PlaybackCoordinator , DetailPresentation , Path , Path ]:
0 commit comments