Add one test case for this behavior: `test14AnimatedImageViewStopPlayingWhenHidden`
This commit is contained in:
parent
29027a693a
commit
983dd59e4f
|
@ -177,6 +177,27 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
||||||
expect(imageView.image).equal(image);
|
expect(imageView.image).equal(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)test14AnimatedImageViewStopPlayingWhenHidden {
|
||||||
|
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
|
||||||
|
#if SD_UIKIT
|
||||||
|
[self.window addSubview:imageView];
|
||||||
|
#else
|
||||||
|
[self.window.contentView addSubview:imageView];
|
||||||
|
#endif
|
||||||
|
SDAnimatedImage *image = [SDAnimatedImage imageWithData:[self testGIFData]];
|
||||||
|
imageView.image = image;
|
||||||
|
#if SD_UIKIT
|
||||||
|
[imageView startAnimating];
|
||||||
|
#else
|
||||||
|
imageView.animates = YES;
|
||||||
|
#endif
|
||||||
|
SDAnimatedImagePlayer *player = imageView.player;
|
||||||
|
expect(player).notTo.beNil();
|
||||||
|
expect(player.isPlaying).beTruthy();
|
||||||
|
imageView.hidden = YES;
|
||||||
|
expect(player.isPlaying).beFalsy();
|
||||||
|
}
|
||||||
|
|
||||||
- (void)test20AnimatedImageViewRendering {
|
- (void)test20AnimatedImageViewRendering {
|
||||||
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView rendering"];
|
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView rendering"];
|
||||||
SDAnimatedImageView *imageView = [[SDAnimatedImageView alloc] init];
|
SDAnimatedImageView *imageView = [[SDAnimatedImageView alloc] init];
|
||||||
|
@ -338,7 +359,7 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
||||||
[self waitForExpectationsWithCommonTimeout];
|
[self waitForExpectationsWithCommonTimeout];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)test25AnimatedImageStopAnimatingClearBuffer {
|
- (void)test26AnimatedImageStopAnimatingClearBuffer {
|
||||||
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView stopAnimating clear buffer when stopped"];
|
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView stopAnimating clear buffer when stopped"];
|
||||||
|
|
||||||
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
|
SDAnimatedImageView *imageView = [SDAnimatedImageView new];
|
||||||
|
|
Loading…
Reference in New Issue