Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455import RealityDriverSupportimport Testing
struct DriverVoiceOverDeliveryTests { @Test func onlyTheCurrentPanelKeyFromTheLiveScreenReaderMatches() { let target = DriverInputTarget(pid: 42, windowID: 7, panel: true) func matches(key: Int64 = 123, source: Int64 = 99, destination: Int64 = 42, time: UInt64 = 101) -> Bool { DriverVoiceOverDelivery.matches( target: target, expectedKey: 123, key: key, sourcePID: source, voiceOverPIDs: [99], targetPID: destination, timestamp: time, armedAt: 100) } #expect(matches()) #expect(!matches(key: 124)) #expect(!matches(source: 98)) #expect(!matches(destination: 43)) #expect(!matches(time: 99)) #expect( !DriverVoiceOverDelivery.belongsToRequest( target: DriverInputTarget(pid: 42, windowID: 7, fixture: true), expectedKey: 123, key: 123, sourcePID: 99, voiceOverPIDs: [99], timestamp: 101, armedAt: 100)) }
@Test func nativeDeliveryNeverExcusesMissingDocumentOrFixtureBarriers() throws { let panel = DriverInputTarget(pid: 42, windowID: 7, panel: true) #expect( try DriverInputVerification.outcome( target: panel, expectation: .shortcut, reachedApplication: true, barrierObserved: true, disabled: false, voiceOverDelivery: true ).contains("VoiceOver native")) #expect(throws: DriverError.self) { try DriverInputVerification.outcome( target: panel, expectation: .shortcut, reachedApplication: true, barrierObserved: false, disabled: false, voiceOverDelivery: true) } for target in [DriverInputTarget(pid: 42, windowID: 7), DriverInputTarget(pid: 42, windowID: 7, fixture: true)] { #expect(throws: DriverError.self) { try DriverInputVerification.outcome( target: target, expectation: .shortcut, reachedApplication: true, barrierObserved: false, disabled: false, voiceOverDelivery: true) } } #expect(throws: DriverError.self) { try DriverInputVerification.outcome( target: panel, expectation: .shortcut, reachedApplication: false, barrierObserved: false, disabled: false, voiceOverDelivery: true) } #expect(throws: DriverError.self) { try DriverInputVerification.outcome( target: panel, expectation: .shortcut, reachedApplication: true, barrierObserved: false, disabled: true, voiceOverDelivery: true) } }}