Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839import Foundation
@MainActorfunc checkSystemVideoPlayer(_ session: RealitySession) async throws { try session.configure() let owned = try await session.startingWindows([.textEdit, .quickTime]) let before = try session.readFrames(owned) try await session.start() func checkFrames() async throws { try await session.expect("Owned video player keeps its native frame; its document neighbor tiles without it") { let frames = try FrameOracle.frames($0, ids: owned.map(\.id)) return frames[1].matches(before[1]) && frames[0].matches(session.visible.inset(16)) } } try await checkFrames() try await session.command("retile") try await checkFrames() let output = try await session.cli(["why", "--json", String(owned[1].id)]) guard output.status == 0 else { throw RealityError("Video player explanation failed: \(output.errors)") } let explanation = try JSONDecoder().decode(SystemPlayerExplanation.self, from: Data(output.output.utf8)) guard explanation.bundleID == RealApp.quickTime.bundleID, explanation.disposition == "float", explanation.reason.contains(RealApp.quickTime.bundleID) else { throw RealityError("Video player explanation did not identify its default floating rule") } try encodeJSON(output, to: session.directory.appendingPathComponent("player-why.json")) session.recordExpectation( "System PiP host identity is unit-tested; this row proves the owned native video player, not PiP creation")}
private struct SystemPlayerExplanation: Decodable { let bundleID: String let disposition: String let reason: String
enum CodingKeys: String, CodingKey { case bundleID = "bundle_id" case disposition, reason }}