From 6a49b26ff3ef989844673cb77d2700404242c424 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Tue, 09 Jun 2026 20:58:01 +0800
Subject: [PATCH] Release 0.0.48 verification candidate
---
C1.source/Tests/AlignerCoreTests/AlignerCoreTests.swift | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/C1.source/Tests/AlignerCoreTests/AlignerCoreTests.swift b/C1.source/Tests/AlignerCoreTests/AlignerCoreTests.swift
index 2dcabd3..298f686 100644
--- a/C1.source/Tests/AlignerCoreTests/AlignerCoreTests.swift
+++ b/C1.source/Tests/AlignerCoreTests/AlignerCoreTests.swift
@@ -212,12 +212,25 @@
let record = makeWindowRecord(
title: "Closed Document.md",
hasAXBacking: false,
- isOnscreen: false,
- spaceIDs: [5]
+ isOnscreen: false
)
XCTAssertFalse(WindowEnumerationPolicy.shouldInclude(record))
XCTAssertNil(WindowEnumerationPolicy.window(from: record))
+ }
+
+ func testWindowEnumerationPolicyKeepsCGOnlyOffscreenWindowsWithKnownSpaceIDs() {
+ let record = makeWindowRecord(
+ title: "Other Space Document.md",
+ hasAXBacking: false,
+ isOnscreen: false,
+ spaceIDs: [5]
+ )
+
+ let window = WindowEnumerationPolicy.window(from: record)
+
+ XCTAssertEqual(window?.title, "Other Space Document.md")
+ XCTAssertEqual(window?.spaceIDs, [5])
}
func testWindowEnumerationPolicyKeepsAXBackedOffscreenWindows() {
@@ -283,13 +296,13 @@
XCTAssertNil(WindowEnumerationPolicy.window(from: tinyRecord))
}
- func testWindowEnumerationPolicyKeepsShottrCGOnlyAnnotationWindow() {
+ func testWindowEnumerationPolicyExcludesClosedShottrCGPlaceholderButKeepsVisibleWindow() {
let shottrApp = AlignerApp(
bundleIdentifier: "cc.ffitch.shottr",
name: "Shottr",
category: .generic
)
- let annotationRecord = WindowEnumerationRecord(
+ let closedPlaceholderRecord = WindowEnumerationRecord(
id: 78,
app: shottrApp,
activationPolicy: .accessory,
@@ -298,6 +311,16 @@
subrole: .standard,
hasAXBacking: false,
isOnscreen: false
+ )
+ let visibleRecord = WindowEnumerationRecord(
+ id: 79,
+ app: shottrApp,
+ activationPolicy: .accessory,
+ title: "Shottr",
+ size: CGSize(width: 1710, height: 997),
+ subrole: .standard,
+ hasAXBacking: false,
+ isOnscreen: true
)
let utilityRecord = WindowEnumerationRecord(
id: 102,
@@ -310,7 +333,8 @@
isOnscreen: false
)
- XCTAssertEqual(WindowEnumerationPolicy.window(from: annotationRecord)?.title, "Shottr")
+ XCTAssertNil(WindowEnumerationPolicy.window(from: closedPlaceholderRecord))
+ XCTAssertEqual(WindowEnumerationPolicy.window(from: visibleRecord)?.title, "Shottr")
XCTAssertNil(WindowEnumerationPolicy.window(from: utilityRecord))
}
--
Gitblit v1.9.3