* fix(native): stop calling an off-screen window absent
The native UI helper looked up its selected window with
`.optionIncludingWindow`, which returned nothing while that window was off
screen. An existing window owned by the selected process was reported as
`window-mismatch`, before any permission check, so the verifier could not reach
its permission boundary. Select from all windows instead; absent and foreign
windows still fail.
The verifier's changed-bytes check also read `error.message`, but since
cc90771af a selection failure carries its helper code in `error.issues`, so the
check could not pass. Read the issue. Together these let the permissions lane
complete on main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(native): own UI test processes from the moment they launch
The off-screen test registered cleanup only after parsing the ready record, so a
startup failure left `/usr/bin/open` and its app running. The lane test killed
only the verifier on a timeout, leaving its launcher and detached fixture alive
until they expired.
Register the off-screen owner immediately after the launch; the app inherits the
run token, so the sweep needs no ready record. In the lane test, every stand-in
records itself and leaves on one release the test's cleanup awaits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
702 B
Swift
15 lines
702 B
Swift
import AppKit
|
|
|
|
// A real window that exists and is never ordered in, so it stays off screen and
|
|
// never appears on the desktop. It expires in case its launcher loses track of it.
|
|
let app = NSApplication.shared
|
|
app.setActivationPolicy(.accessory)
|
|
let window = NSWindow(contentRect: NSRect(x: 120, y: 120, width: 240, height: 80), styleMask: [.titled], backing: .buffered, defer: false)
|
|
window.title = "REA off-screen window fixture"
|
|
DispatchQueue.main.async {
|
|
let record = "{\"pid\":\(ProcessInfo.processInfo.processIdentifier),\"window_id\":\(window.windowNumber)}\n"
|
|
FileHandle.standardOutput.write(Data(record.utf8))
|
|
}
|
|
DispatchQueue.main.asyncAfter(deadline: .now() + 300) { exit(0) }
|
|
app.run()
|