Skip to content

Commit b8fcbdb

Browse files
committed
refactor(ios-runner): fail a gesture with no resolved window directly
The gesture callers resolve the window in Swift before the call, so a nil resolved window already means no window qualified. Walking windows.firstMatch a second time in record creation could only book a display that every Swift caller had refused to book geometry against; the missing window is now the error.
1 parent 8430988 commit b8fcbdb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerSynthesizedGesture.m‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,10 @@ + (NSInteger)interfaceOrientationForApplication:(id)application {
333333
if (missing != nil) return missing;
334334

335335
NSUInteger displayID = 0;
336-
NSString *displayError = resolvedWindow != nil
337-
? RunnerResolveWindowDisplayID(resolvedWindow, &displayID)
338-
: RunnerResolveApplicationDisplayID(application, &displayID);
336+
if (resolvedWindow == nil) {
337+
return @"private XCTest event synthesis unavailable: no resolved application window";
338+
}
339+
NSString *displayError = RunnerResolveWindowDisplayID(resolvedWindow, &displayID);
339340
if (displayError != nil) return displayError;
340341
NSInteger interfaceOrientation =
341342
((RunnerMsgSendInteger)objc_msgSend)(application, bridge->interfaceOrientationSelector);

0 commit comments

Comments
 (0)