| | |
| | | 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", |