@@ -19,7 +19,7 @@ import {
1919import type { BindDeviceRuntime , BindExactDeviceRuntime } from '../request-runtime-binding.ts' ;
2020import type { DeviceInfo } from '@agent-device/kernel/device' ;
2121import { applicationLifecycleRuntimeFixture } from './application-lifecycle-runtime-fixture.ts' ;
22- import { unavailableDeploymentSnapshotAndShutdownOperationFacts } from '../../__tests__/test-utils/runtime-operation-facts.ts' ;
22+ import { createUnavailableRuntimeFactsForTest } from '../../__tests__/test-utils/runtime-operation-facts.ts' ;
2323import { withClientReplayScriptSources } from '../../__tests__/test-utils/replay-script-source.ts' ;
2424import type { DaemonInvokeFn } from '../types.ts' ;
2525import { clearAndroidObservationFixture } from './android-observation-fixture.ts' ;
@@ -47,36 +47,14 @@ function lifecycleFactsForTest(device: DeviceInfo): ApplicationLifecycleOperatio
4747
4848async function lifecycleBindingForTest ( device : DeviceInfo ) {
4949 const lifecycleFacts = lifecycleFactsForTest ( device ) ;
50+ const base = createUnavailableRuntimeFactsForTest ( device , localRuntimeOwner ( device . platform ) ) ;
5051 return {
5152 device,
5253 owner : localRuntimeOwner ( device . platform ) ,
5354 facts : {
54- device : {
55- family : device . platform ,
56- kind : device . kind ,
57- providerMode : 'local' as const ,
58- ...( device . appleOs === undefined ? { } : { appleOs : device . appleOs } ) ,
59- ...( device . target === undefined ? { } : { target : device . target } ) ,
60- ...( device . iosPhysicalDeviceBackend === undefined
61- ? { }
62- : { iosPhysicalDeviceBackend : device . iosPhysicalDeviceBackend } ) ,
63- } ,
55+ device : base . device ,
6456 operations : {
65- ...unavailableDeploymentSnapshotAndShutdownOperationFacts ,
66- appLogInspect : unavailable ,
67- appLogDoctor : unavailable ,
68- appLogStart : unavailable ,
69- appLogReattach : unavailable ,
70- appLogCleanup : unavailable ,
71- appState : unavailable ,
72- networkDump : unavailable ,
73- screenRecordingStart : unavailable ,
74- screenRecordingReattach : unavailable ,
75- screenRecordingCleanup : unavailable ,
76- ensureReady : unavailable ,
77- bootTarget : unavailable ,
78- bootTargetHeadless : unavailable ,
79- listApps : unavailable ,
57+ ...base . operations ,
8058 ...lifecycleFacts ,
8159 ...admittedGestureFamilyFacts ,
8260 ...admittedSystemFamilyFacts ,
@@ -109,52 +87,16 @@ export const lifecycleDeviceRuntimeGateway: DeviceRuntimeGateway<PlatformRuntime
10987export const unavailableDeviceRuntimeGateway : DeviceRuntimeGateway < PlatformRuntimeOperations > =
11088 Object . freeze ( {
11189 inspectFacts : async ( device ) => ( await unavailableBinding ( device ) ) . facts ,
112- bind : async ( { device } ) => ( {
113- device,
114- owner : localRuntimeOwner ( device . platform ) ,
115- facts : {
116- device : {
117- family : device . platform ,
118- kind : device . kind ,
119- providerMode : 'local' ,
120- ...( device . appleOs === undefined ? { } : { appleOs : device . appleOs } ) ,
121- ...( device . target === undefined ? { } : { target : device . target } ) ,
122- ...( device . iosPhysicalDeviceBackend === undefined
123- ? { }
124- : { iosPhysicalDeviceBackend : device . iosPhysicalDeviceBackend } ) ,
125- } ,
126- operations : {
127- ...unavailableDeploymentSnapshotAndShutdownOperationFacts ,
128- appLogInspect : unavailable ,
129- appLogDoctor : unavailable ,
130- appLogStart : unavailable ,
131- appLogReattach : unavailable ,
132- appLogCleanup : unavailable ,
133- appState : unavailable ,
134- networkDump : unavailable ,
135- screenRecordingStart : unavailable ,
136- screenRecordingReattach : unavailable ,
137- screenRecordingCleanup : unavailable ,
138- ensureReady : unavailable ,
139- bootTarget : unavailable ,
140- bootTargetHeadless : unavailable ,
141- listApps : unavailable ,
142- ...applicationLifecycleOperationFacts ( {
143- resolveOpenTarget : unavailable ,
144- prepareApplicationOpen : unavailable ,
145- openApplication : unavailable ,
146- applyRuntimeHints : unavailable ,
147- clearRuntimeHints : unavailable ,
148- closeApplication : unavailable ,
149- finalizeApplicationClose : unavailable ,
150- prepareAppleRunner : unavailable ,
151- configureProviderPortReverse : unavailable ,
152- } ) ,
153- } ,
154- } ,
155- operations : { } ,
156- [ Symbol . asyncDispose ] : async ( ) => { } ,
157- } ) ,
90+ bind : async ( { device } ) => {
91+ const owner = localRuntimeOwner ( device . platform ) ;
92+ return {
93+ device,
94+ owner,
95+ facts : createUnavailableRuntimeFactsForTest ( device , owner ) ,
96+ operations : { } ,
97+ [ Symbol . asyncDispose ] : async ( ) => { } ,
98+ } ;
99+ } ,
158100 shutdown : async ( ) => { } ,
159101 } ) ;
160102
0 commit comments