FIX Fixed AutoPlayAnimatedImage test case
This commit is contained in:
parent
20d2369304
commit
bfc827c804
|
@ -183,8 +183,11 @@
|
|||
|
||||
// Ensure disabled highlighting; it's not supported (see `-setHighlighted:`).
|
||||
super.highlighted = NO;
|
||||
|
||||
#if SD_UIKIT
|
||||
[self stopAnimating];
|
||||
#else
|
||||
[self setAnimates:NO];
|
||||
#endif
|
||||
[self checkPlay];
|
||||
|
||||
[self.imageViewLayer setNeedsDisplay];
|
||||
|
@ -389,11 +392,19 @@
|
|||
{
|
||||
if (self.autoPlayAnimatedImage) {
|
||||
[self updateShouldAnimate];
|
||||
#if SD_UIKIT
|
||||
if (self.shouldAnimate) {
|
||||
[self startAnimating];
|
||||
} else {
|
||||
[self stopAnimating];
|
||||
}
|
||||
#else
|
||||
if (self.shouldAnimate) {
|
||||
[self setAnimates:YES];
|
||||
} else {
|
||||
[self setAnimates:NO];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -483,28 +483,39 @@ static const NSUInteger kTestGIFFrameCount = 5; // local TestImage.gif loop coun
|
|||
SDAnimatedImage *image = [SDAnimatedImage imageWithData:[self testAPNGPData]];
|
||||
imageView.image = image;
|
||||
|
||||
#if SD_UIKIT
|
||||
expect(imageView.animating).equal(0);
|
||||
#else
|
||||
expect(imageView.animates).equal(0);
|
||||
#endif
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
#if SD_UIKIT
|
||||
expect(imageView.animating).equal(0);
|
||||
#else
|
||||
expect(imageView.animates).equal(0);
|
||||
#endif
|
||||
|
||||
#if SD_UIKIT
|
||||
[imageView startAnimating];
|
||||
#else
|
||||
imageView.animates = YES;
|
||||
#endif
|
||||
|
||||
expect(imageView.animating).equal(1);
|
||||
});
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
#if SD_UIKIT
|
||||
expect(imageView.animating).equal(1);
|
||||
#else
|
||||
expect(imageView.animates).equal(1);
|
||||
#endif
|
||||
|
||||
#if SD_UIKIT
|
||||
[imageView stopAnimating];
|
||||
#else
|
||||
imageView.animates = NO;
|
||||
#endif
|
||||
|
||||
[imageView removeFromSuperview];
|
||||
[expectation fulfill];
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue