Skip to content

Commit f4944b5

Browse files
committed
style(ios-runner): node: imports in the parity guard; trim the shared rule block
Fixes the lint failure at 17ae6b1 and cuts the pinned block to the rule its two callers actually share, which is the size the review asked for.
1 parent 17ae6b1 commit f4944b5

3 files changed

Lines changed: 21 additions & 35 deletions

File tree

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

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,27 @@
1111
#endif
1212

1313
// AGENT_DEVICE_FULL_SCREEN_RULE_BEGIN
14-
// One rule, two targets, one block. The Simulator snapshot bridge refuses a capture whose app
15-
// window does not fill the screen (`app-window-not-full-screen`, #3844), and the runner refuses to
16-
// route a window-less gesture onto a screen it cannot prove the app fills. Both read the same two
17-
// frames from the same private AX runtime in one native space. The two binaries build from
18-
// disjoint source roots in the checkout and in a packaged install, so no include path reaches both
19-
// builds; `test/repo-guards/full-screen-rule-parity.test.ts` pins the two copies of this block
20-
// byte-identical. Each caller keeps its own policy for what a missing read proves; this block
21-
// states only what the runtime reports.
22-
23-
// The AXRuntime class both targets reach without walking the app's accessibility tree, so both
24-
// answer on a tree XCTest cannot serialize.
14+
// One rule, two targets. The Simulator snapshot bridge refuses a capture whose app window does not
15+
// fill the screen (`app-window-not-full-screen`, #3844), and the runner refuses to route a
16+
// window-less gesture onto a screen it cannot prove the app fills. The two builds read disjoint
17+
// source roots whose packaged layouts differ, so no include path reaches both; this block is
18+
// carried by both sources and pinned byte-identical by
19+
// `test/repo-guards/full-screen-rule-parity.test.ts`. Each caller keeps its own unknown policy.
2520
@protocol AgentDeviceForegroundElement <NSObject>
2621
+ (nullable id<AgentDeviceForegroundElement>)primaryApp;
2722
+ (nullable id<AgentDeviceForegroundElement>)systemApplication;
2823
- (pid_t)pid;
2924
- (CGRect)frame;
3025
@end
3126

32-
// Whether the accessibility primary app is the process this capture or gesture belongs to. While a
33-
// system surface owns the foreground, no screen is the target app's to fill and no tree is the
34-
// target app's to capture (ADR 0004, foreground ownership).
27+
// While a system surface owns the foreground, no screen is the target app's to fill and no tree is
28+
// the target app's to capture (ADR 0004, foreground ownership).
3529
static BOOL AgentDeviceForegroundOwnershipMatches(pid_t primaryProcessID, pid_t targetProcessID) {
3630
return primaryProcessID == targetProcessID;
3731
}
3832

39-
// How far apart two screen-native frames may be and still name the same rectangle. Sub-pixel
40-
// layout rounding is not a window; anything past this is a window that shows the app in part of
41-
// the screen (Windowed Apps or Stage Manager).
33+
// Sub-pixel layout rounding is not a window; anything past this is one that shows the app in part
34+
// of the screen (Windowed Apps or Stage Manager).
4235
static const CGFloat AgentDeviceFullScreenFrameTolerance = 0.5;
4336

4437
static BOOL AgentDeviceForegroundWindowFillsScreen(CGRect window, CGRect screen) {

‎apple/snapshot-bridge/SnapshotBridgeRuntime.m‎

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,34 +68,27 @@ + (nullable XCAccessibilityElement *)elementWithProcessIdentifier:(pid_t)pid;
6868
@end
6969

7070
// AGENT_DEVICE_FULL_SCREEN_RULE_BEGIN
71-
// One rule, two targets, one block. The Simulator snapshot bridge refuses a capture whose app
72-
// window does not fill the screen (`app-window-not-full-screen`, #3844), and the runner refuses to
73-
// route a window-less gesture onto a screen it cannot prove the app fills. Both read the same two
74-
// frames from the same private AX runtime in one native space. The two binaries build from
75-
// disjoint source roots in the checkout and in a packaged install, so no include path reaches both
76-
// builds; `test/repo-guards/full-screen-rule-parity.test.ts` pins the two copies of this block
77-
// byte-identical. Each caller keeps its own policy for what a missing read proves; this block
78-
// states only what the runtime reports.
79-
80-
// The AXRuntime class both targets reach without walking the app's accessibility tree, so both
81-
// answer on a tree XCTest cannot serialize.
71+
// One rule, two targets. The Simulator snapshot bridge refuses a capture whose app window does not
72+
// fill the screen (`app-window-not-full-screen`, #3844), and the runner refuses to route a
73+
// window-less gesture onto a screen it cannot prove the app fills. The two builds read disjoint
74+
// source roots whose packaged layouts differ, so no include path reaches both; this block is
75+
// carried by both sources and pinned byte-identical by
76+
// `test/repo-guards/full-screen-rule-parity.test.ts`. Each caller keeps its own unknown policy.
8277
@protocol AgentDeviceForegroundElement <NSObject>
8378
+ (nullable id<AgentDeviceForegroundElement>)primaryApp;
8479
+ (nullable id<AgentDeviceForegroundElement>)systemApplication;
8580
- (pid_t)pid;
8681
- (CGRect)frame;
8782
@end
8883

89-
// Whether the accessibility primary app is the process this capture or gesture belongs to. While a
90-
// system surface owns the foreground, no screen is the target app's to fill and no tree is the
91-
// target app's to capture (ADR 0004, foreground ownership).
84+
// While a system surface owns the foreground, no screen is the target app's to fill and no tree is
85+
// the target app's to capture (ADR 0004, foreground ownership).
9286
static BOOL AgentDeviceForegroundOwnershipMatches(pid_t primaryProcessID, pid_t targetProcessID) {
9387
return primaryProcessID == targetProcessID;
9488
}
9589

96-
// How far apart two screen-native frames may be and still name the same rectangle. Sub-pixel
97-
// layout rounding is not a window; anything past this is a window that shows the app in part of
98-
// the screen (Windowed Apps or Stage Manager).
90+
// Sub-pixel layout rounding is not a window; anything past this is one that shows the app in part
91+
// of the screen (Windowed Apps or Stage Manager).
9992
static const CGFloat AgentDeviceFullScreenFrameTolerance = 0.5;
10093

10194
static BOOL AgentDeviceForegroundWindowFillsScreen(CGRect window, CGRect screen) {

‎test/repo-guards/full-screen-rule-parity.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'node:assert/strict';
22
import fs from 'node:fs';
3-
import path from 'path';
3+
import path from 'node:path';
44
import { fileURLToPath } from 'node:url';
55
import { test } from 'vitest';
66

0 commit comments

Comments
 (0)