@@ -39,24 +39,22 @@ class WebImageTests: XCTestCase {
39
39
40
40
func testWebImageWithAnimatedURL( ) throws {
41
41
let expectation = self . expectation ( description: " WebImage animated url initializer " )
42
- let imageUrl = URL ( string: " http ://apng.onevcat.com/assets/elephant.png" )
42
+ let imageUrl = URL ( string: " https ://apng.onevcat.com/assets/elephant.png" )
43
43
let binding = Binding < Bool > ( wrappedValue: true )
44
44
let imageView = WebImage ( url: imageUrl, isAnimating: binding)
45
45
let introspectView = imageView. onSuccess { image, cacheType in
46
46
if let animatedImage = image as? SDAnimatedImage {
47
- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 1 ) {
48
- XCTAssertTrue ( imageView. isAnimating)
49
- #if os(iOS) || os(tvOS)
50
- let displayImage = try ? imageView. inspect ( ) . group ( ) . image ( 0 ) . uiImage ( )
51
- #else
52
- let displayImage = try ? imageView. inspect ( ) . group ( ) . image ( 0 ) . nsImage ( )
53
- #endif
54
- XCTAssertNotNil ( displayImage)
55
- // Check display image should match the animated poster frame
56
- let posterImage = animatedImage. animatedImageFrame ( at: 0 )
57
- XCTAssertEqual ( displayImage? . size, posterImage? . size)
58
- expectation. fulfill ( )
59
- }
47
+ XCTAssertTrue ( imageView. isAnimating)
48
+ #if os(iOS) || os(tvOS)
49
+ let displayImage = try ? imageView. inspect ( ) . group ( ) . image ( 0 ) . uiImage ( )
50
+ #else
51
+ let displayImage = try ? imageView. inspect ( ) . group ( ) . image ( 0 ) . nsImage ( )
52
+ #endif
53
+ XCTAssertNotNil ( displayImage)
54
+ // Check display image should match the animated poster frame
55
+ let posterImage = animatedImage. animatedImageFrame ( at: 0 )
56
+ XCTAssertEqual ( displayImage? . size, posterImage? . size)
57
+ expectation. fulfill ( )
60
58
} else {
61
59
XCTFail ( " WebImage animated image invalid " )
62
60
}
0 commit comments