Add a simple test case to ensure SDAnimatedImageView should display the static NSImage

This commit is contained in:
DreamPiggy 2019-04-25 14:13:56 +08:00
parent 8c93519191
commit 9cce513a09
1 changed files with 12 additions and 0 deletions

View File

@ -137,6 +137,18 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
expect(imageView.intrinsicContentSize).equal(image.size);
}
- (void)test12AnimatedImageViewLayerContents {
// Test that SDAnimatedImageView with built-in UIImage/NSImage will actually setup the layer for display
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
UIImage *image = [[UIImage alloc] initWithData:[self testJPEGData]];
imageView.image = image;
#if SD_MAC
expect(imageView.wantsUpdateLayer).beTruthy();
#else
expect(imageView.layer.contents).notTo.beNil();
#endif
}
- (void)test20AnimatedImageViewRendering {
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView rendering"];
SDAnimatedImageView *imageView = [[SDAnimatedImageView alloc] init];