Skip to content

Commit dc46eeb

Browse files
Support for xcode 15b1 (#737)
* Fix compile errors with Xcode-15.0b1 * Fix warnings * Update snapshots * wip --------- Co-authored-by: Stephen Celis <[email protected]>
1 parent f5489a2 commit dc46eeb

18 files changed

+13
-21
lines changed

Sources/SnapshotTesting/Snapshotting/CALayer.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
4+
import QuartzCore
35

46
extension Snapshotting where Value == CALayer, Format == NSImage {
57
/// A snapshot strategy for comparing layers based on pixel equality.

Sources/SnapshotTesting/Snapshotting/CGPath.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
4+
import CoreGraphics
35

46
extension Snapshotting where Value == CGPath, Format == NSImage {
57
/// A snapshot strategy for comparing bezier paths based on pixel equality.

Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
34

45
extension Snapshotting where Value == NSBezierPath, Format == NSImage {
@@ -30,6 +31,7 @@ extension Snapshotting where Value == NSBezierPath, Format == NSImage {
3031

3132
extension Snapshotting where Value == NSBezierPath, Format == String {
3233
/// A snapshot strategy for comparing bezier paths based on pixel equality.
34+
@available(macOS 11.0, *)
3335
@available(iOS 11.0, *)
3436
public static var elementsDescription: Snapshotting {
3537
return .elementsDescription(numberFormatter: defaultNumberFormatter)
@@ -38,6 +40,7 @@ extension Snapshotting where Value == NSBezierPath, Format == String {
3840
/// A snapshot strategy for comparing bezier paths based on pixel equality.
3941
///
4042
/// - Parameter numberFormatter: The number formatter used for formatting points.
43+
@available(macOS 11.0, *)
4144
@available(iOS 11.0, *)
4245
public static func elementsDescription(numberFormatter: NumberFormatter) -> Snapshotting {
4346
let namesByType: [NSBezierPath.ElementType: String] = [

Sources/SnapshotTesting/Snapshotting/NSView.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
34

45
extension Snapshotting where Value == NSView, Format == NSImage {

Sources/SnapshotTesting/Snapshotting/NSViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
34

45
extension Snapshotting where Value == NSViewController, Format == NSImage {

Tests/SnapshotTestingTests/SnapshotTestingTests.swift

+1-18
Original file line numberDiff line numberDiff line change
@@ -1127,24 +1127,6 @@ final class SnapshotTestingTests: XCTestCase {
11271127
_ = manipulatingWKWebViewNavigationDelegate
11281128
}
11291129

1130-
#if os(iOS) || os(macOS)
1131-
func testWebViewWithRealUrl() throws {
1132-
let manipulatingWKWebViewNavigationDelegate = ManipulatingWKWebViewNavigationDelegate()
1133-
let webView = WKWebView()
1134-
webView.navigationDelegate = manipulatingWKWebViewNavigationDelegate
1135-
1136-
webView.load(URLRequest(url: URL(string: "https://www.pointfree.co")!))
1137-
if !ProcessInfo.processInfo.environment.keys.contains("GITHUB_WORKFLOW") {
1138-
assertSnapshot(
1139-
matching: webView,
1140-
as: .image(size: .init(width: 800, height: 600)),
1141-
named: platform
1142-
)
1143-
}
1144-
_ = manipulatingWKWebViewNavigationDelegate
1145-
}
1146-
#endif
1147-
11481130
final class CancellingWKWebViewNavigationDelegate: NSObject, WKNavigationDelegate {
11491131
func webView(
11501132
_ webView: WKWebView,
@@ -1154,6 +1136,7 @@ final class SnapshotTestingTests: XCTestCase {
11541136
decisionHandler(.cancel)
11551137
}
11561138
}
1139+
11571140
func testWebViewWithCancellingNavigationDelegate() throws {
11581141
let cancellingWKWebViewNavigationDelegate = CancellingWKWebViewNavigationDelegate()
11591142
let webView = WKWebView()
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ AF ! U ] h=--- v=--- NSButton "Push Me" f=(0,0,83,32) b=(-)
2-
[ A ! U ] h=--- v=--- NSButtonBezelView f=(0,0,83,32) b=(-)
3-
[ AF ! U ] h=--- v=--- NSButtonTextField "Push Me" f=(11,7,61,15) b=(-)
1+
[ AF ! wLU ] h=--- v=--- NSButton "Push Me" f=(0,0,83,32) b=(-) => <_NSViewBackingLayer>
2+
[ A ! wLU ] h=--- v=--- NSButtonBezelView f=(0,0,83,32) b=(-) => <_NSViewBackingLayer>
3+
[ AF ! wLU ] h=--- v=--- NSButtonTextField "Push Me" f=(11,7,61,15) b=(-) => <NSTextLayer>
44
A=autoresizesSubviews, C=canDrawConcurrently, D=needsDisplay, F=flipped, G=gstate, H=hidden (h=by ancestor), L=needsLayout (l=child needsLayout), U=needsUpdateConstraints (u=child needsUpdateConstraints), O=opaque, P=preservesContentDuringLiveResize, S=scaled/rotated, W=wantsLayer (w=ancestor wantsLayer), V=needsVibrancy (v=allowsVibrancy), #=has surface
Loading
Loading
Loading

0 commit comments

Comments
 (0)