mirror of
https://github.com/NanmiCoder/claude-code-haha.git
synced 2026-10-10 20:03:13 +08:00
56c6a9aa8e
Add a persistent isolated JavaScript worker for native app actions and batch known operations without a model round trip between each input. Preserve per-cell context, native errors, screenshot coordinates, and image types. Align macOS gesture, key, inventory, capture, scroll, and clipboard behavior; include a signed native receiver fixture and compiled sidecar regression tests. Keep the Windows pixel route and fix cancellation with session-owned mouse cleanup, lock revalidation, and portable signing-fixture tests.
29 lines
1.1 KiB
Swift
29 lines
1.1 KiB
Swift
import XCTest
|
|
@testable import cc_haha_computer_use
|
|
|
|
#if DEBUG
|
|
final class ProcessValidationObservationTests: XCTestCase {
|
|
@MainActor
|
|
func testObserverSeesTheActualFailedComparisonWithoutAllowingTheTarget() throws {
|
|
let expected = try XCTUnwrap(ProvenProcessTarget(
|
|
pid: .max,
|
|
identity: AXTreeProcessIdentity(
|
|
bundleID: "dev.cchaha.tests.missing",
|
|
executablePath: "/missing/process",
|
|
launchTime: 100
|
|
)
|
|
))
|
|
let previous = Injection.targetValidationObserver
|
|
defer { Injection.targetValidationObserver = previous }
|
|
var observed: [(ProvenProcessTarget, AXTreeProcessIdentity?)] = []
|
|
Injection.targetValidationObserver = { observed.append(($0, $1)) }
|
|
XCTAssertThrowsError(try Injection.validateAuthorizedTarget(expected)) {
|
|
XCTAssertEqual(($0 as? CUError)?.code, "stale_process")
|
|
}
|
|
XCTAssertEqual(observed.count, 1)
|
|
XCTAssertEqual(observed.first?.0, expected)
|
|
XCTAssertNil(observed.first?.1)
|
|
}
|
|
}
|
|
#endif
|