Repository navigation
[KS] Driver runs: make remaining host observers inert (#433) - #451
Merged
Merged
Conversation
Under the test driver, the displays observer, motion's power, screen and occlusion observers and the window manager's screen observer install no host sources. getSystemInfo, getNetworkStatus and getAppearancePreferences report fixed driver values for fields no simulation sets; launch arguments pin Reduce Motion and the appearance setting. Motion pins 60 Hz. Native tests cover both modes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #433
What changed
Under
SPARK_TEST_DRIVER(production unchanged):SparkDisplayObserver): a driver run installs only the simulation observer. No screen-parameter, color-space orCGDisplayRegisterReconfigurationCallbacksource, so a real display change can't add adisplayDetailsChangedentry.maximumFramesPerSecond), next to Reduce Motion, Reduce Transparency and Low Power Mode.simulateDisplaysrestore now goes back to 60 Hz, not the real display's rate.RNWindowManager: noscreensChanged:observer in driver runs.simulateSystemEventoverrides them as before:getSystemInfo:onBattery: false,batteryLevel: null,idleSeconds: 0,timeZone: "UTC",lowPowerMode: false,thermalState: "nominal"getNetworkStatus: online,["wired"], not expensive or constrained, all proxies null. No path monitor runs.getAppearancePreferences:invertColorsandkeyboardNavigationfalse-reduceMotion NO,-AppleInterfaceStyle Lightand-AppleInterfaceStyleSwitchesAutomatically NOjoinPINNED_DEFAULTS. The other appearance fields were already pinned.preferences-realstill overrides them.osVersion,architecture,translated,localeanddark. These are the process's own facts: the OS, the build, Rosetta, the launch locale and the app's effective appearance.system.md,displays.md,motion.mdandtest-driver.md(pinned-host-settings table).system-integration/statenow asserts exact driver values.state-visualmasks only the OS version row; it used to mask the whole info and network panels.motion-system/visualno longer masks the accessibility-power environment readout.preferences-realasserts that invert colors and keyboard navigation are false.Native tests (both modes)
tests/system-events.native.mm: outside a driver run, the reads report the host (time zone, Low Power Mode, a real path, invert colors and keyboard navigation). In a driver run, after driver start, they report the fixed values, and simulations replace them (offline, thermal serious).tests/displays.native.mm: in driver mode, screen-parameter and color-space notifications don't reach the handler, and simulation changes do.tests/motion-coordinator.native.mm: the driven coordinator has 1 observer and no accessibility observer, and reports a pinned environment of 60 Hz. The app coordinator has 5 observers plus the accessibility one. Restore returns to 60 Hz.tests/window-manager.native.mm: a screen-parameter notification reachesonDisplaysChangedonly outside driver mode.Other host sources a driver run can still see (not fixed here)
SparkFrameTimeline(assertFrames) measures the real display link. That's inherent: it fails with 0 frames while the display sleeps.getDisplayDetailswithout a simulation reports the real displays (intended:displays-real).TISCopyCurrentASCIICapableKeyboardLayoutInputSource), and so does keyboard navigation in AppKit.RCTAccessibilityManager(react-native-macos) still observes accessibility display changes. The values it re-reads are pinned by launch arguments.AppleInterfaceThemeChangedand system color changes. Its appearance read is pinned by-AppleInterfaceStyle Light.Verification (run in this session)
bun run typecheck: pass.bun run test: 1980 passed, 2 failed. Both are the accepted host failures:node-runtime(asdf shim) and themotion-nativeframes check (frames >= 5, display asleep). The frames check also fails on the base.bun run e2e:lint: 0 problems.rebuild:macos). Then, with--backend driverunderks-lock native, randisplays-graphics,system-integration,appearance-theming,motion-systemandinfra/catalog-driver: 75 passed, 9 skipped (Windows-only), 2 failed. Neither failure comes from this change:appearance-theming/app-icon-buildneeds${APP_PATH}(gate-only).motion-system/js-blockhitassertFrames: 0 display-link frames while the display sleeps.system-integration-stateandmotion-system-accessibility-powerwith their masks reduced. No golden was re-approved.multiwindow(display listener and simulated displays): 28 passed, 4 skipped. The 5 failures are flows that needfocusWindow, which the driver backend doesn't support.