Ariver
2026-06-18 16ee4576a9ff3c4f91cc30cb4cedbfb41fb3de14
C1.source/Tests/AlignerCoreTests/AlignerCoreTests.swift
@@ -533,6 +533,58 @@
        XCTAssertTrue(attributed[1].isFullscreen)
    }
    func testFinderTabSpaceAttributionRejectsContainingHostsWithDifferentSize() {
        let finderApp = AlignerApp(
            bundleIdentifier: "com.apple.finder",
            name: "访达",
            category: .finder,
            processIdentifier: 74678
        )
        let splitRightFrame = CGRect(x: 960, y: 0, width: 960, height: 1080)
        let fullDisplayFrame = CGRect(x: 0, y: 0, width: 1920, height: 1080)
        let splitHost = WindowEnumerationRecord(
            id: 33112,
            app: finderApp,
            title: "下载",
            size: splitRightFrame.size,
            frame: splitRightFrame,
            subrole: .standard,
            isFullscreen: true,
            hasAXBacking: true,
            spaceIDs: [843]
        )
        let containingHost = WindowEnumerationRecord(
            id: 41557,
            app: finderApp,
            title: "应用程序",
            size: fullDisplayFrame.size,
            frame: fullDisplayFrame,
            subrole: .standard,
            isFullscreen: true,
            hasAXBacking: true,
            spaceIDs: [1112]
        )
        let inactiveTab = WindowEnumerationRecord(
            id: 42286,
            app: finderApp,
            title: "Appcache",
            size: splitRightFrame.size,
            frame: splitRightFrame,
            subrole: .standard,
            hasAXBacking: false,
            isOnscreen: false
        )
        let attributed = FinderTabSpaceAttributionPolicy.attributedRecords([
            inactiveTab,
            containingHost,
            splitHost
        ])
        XCTAssertEqual(attributed[0].spaceIDs, [843])
        XCTAssertTrue(attributed[0].isFullscreen)
    }
    func testWindowEnumerationPolicyKeepsMinimizedAndFullscreenCGOnlyOffscreenWindows() {
        let minimized = makeWindowRecord(
            title: "Minimized Document.md",
@@ -655,6 +707,13 @@
        XCTAssertTrue(templates.allSatisfy { $0.contentRows > 0 })
    }
    func testSkeletonThumbnailPaletteStaysQuietForFallbackState() {
        XCTAssertLessThanOrEqual(SkeletonThumbnailPalette.headerAlpha, 0.10)
        XCTAssertLessThanOrEqual(SkeletonThumbnailPalette.contentRowAlpha, 0.08)
        XCTAssertLessThanOrEqual(SkeletonThumbnailPalette.accentStripeAlpha, 0.30)
        XCTAssertGreaterThanOrEqual(SkeletonThumbnailPalette.titleBandAlpha, 0.80)
    }
    @MainActor
    func testNativeSkeletonThumbnailProviderProducesValidImages() {
        let provider = NativeSkeletonThumbnailProvider()