From c3d8e1d4cab875fc12159cacf34498a976fc3c7d Mon Sep 17 00:00:00 2001 From: Nick Entin Date: Wed, 28 Aug 2024 17:44:06 -0700 Subject: [PATCH] Remove test that relies on deprecated APIs --- ParalayoutTests/PixelRoundingTests.swift | 47 ------------------------ 1 file changed, 47 deletions(-) diff --git a/ParalayoutTests/PixelRoundingTests.swift b/ParalayoutTests/PixelRoundingTests.swift index 357fcac..5cc4178 100644 --- a/ParalayoutTests/PixelRoundingTests.swift +++ b/ParalayoutTests/PixelRoundingTests.swift @@ -20,24 +20,6 @@ import XCTest final class PixelRoundingTests: XCTestCase { - // MARK: - Private Types - - @MainActor - private enum Samples { - static let window = UIWindow(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) - static let view = UIView() - } - - // MARK: - XCTest - - override func setUp() async throws { - try await super.setUp() - - await Task { @MainActor in - Samples.window.addSubview(Samples.view) - }.value - } - // MARK: - Tests - Pixel Rounding @MainActor @@ -112,33 +94,4 @@ final class PixelRoundingTests: XCTestCase { ) } - // MARK: - Tests - Scale Factor - - @MainActor - func testViewScaleFactor() { - // A view should inherit the scale factor of its parent screen. - for screen in screensToTest() { - Samples.window.screen = screen - XCTAssertEqual(Samples.view.pixelsPerPoint, screen.pixelsPerPoint) - } - - // With no superview, the main screen's scale should be used. - Samples.view.removeFromSuperview() - XCTAssert(Samples.view.pixelsPerPoint == UIScreen.main.pixelsPerPoint) - } - - // MARK: - Private Methods - - @MainActor - private func screensToTest() -> [UIScreen] { - if #available(iOS 13, *) { - // In iOS 13 and later, there is a bug around setting `UIWindow.screen` that prevents us from testing - // multiple screens (FB8674601). - return [.main] - - } else { - return TestScreen.all - } - } - }