@@ -28,6 +28,14 @@ beforeEach(() => {
2828 vi . clearAllMocks ( ) ;
2929} ) ;
3030
31+ const macosDevice = {
32+ ...device ,
33+ appleOs : 'macos' as const ,
34+ id : 'host-macos-local' ,
35+ name : 'Mac' ,
36+ target : 'desktop' as const ,
37+ } ;
38+
3139test ( 'scopes an unavailable runner authority instead of falling back to a local lease' , async ( ) => {
3240 await withAppleRunnerScreenRecordingTransport ( undefined , async ( ) => {
3341 const transport = resolveAppleRunnerScreenRecordingTransport ( ) ;
@@ -97,3 +105,27 @@ test('does not issue an unowned stop when runner acquisition exposes no session
97105
98106 expect ( runner . run ) . toHaveBeenCalledOnce ( ) ;
99107} ) ;
108+
109+ test ( 'keeps macOS runner recording ownership local to the requested output path' , async ( ) => {
110+ runner . snapshot . mockReturnValue ( { sessionId : 'runner-session-1' , alive : true } ) ;
111+ runner . run . mockResolvedValue ( { recorderStartUptimeMs : 42 } ) ;
112+ const transport = resolveAppleRunnerScreenRecordingTransport ( ) ;
113+
114+ await expect (
115+ transport . start ( {
116+ device : macosDevice ,
117+ appBundleId : 'com.apple.TextEdit' ,
118+ outputPath : '/tmp/capture.mp4' ,
119+ } ) ,
120+ ) . resolves . toEqual ( { runnerSessionId : 'runner-session-1' , recorderStartUptimeMs : 42 } ) ;
121+
122+ expect ( runner . run ) . toHaveBeenCalledWith (
123+ macosDevice ,
124+ {
125+ command : 'recordStart' ,
126+ outPath : '/tmp/capture.mp4' ,
127+ appBundleId : 'com.apple.TextEdit' ,
128+ } ,
129+ { signal : undefined } ,
130+ ) ;
131+ } ) ;
0 commit comments