aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/AnimatedImageTest.cpp
diff options
context:
space:
mode:
authorGravatar Leon Scroggins III <scroggo@google.com>2018-01-26 11:06:12 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-26 20:08:40 +0000
commitabe639caf407bba695c9c3eba7779fad8ae4f0db (patch)
tree428b9356c8132fe5570f537ef5770243c7652632 /tests/AnimatedImageTest.cpp
parent333848272c4d023199e44ff38f2e6fc6876388e8 (diff)
Add SkAnimatedImage::getRepetitionCount
Bug: b/63908092 Android does not need to have its end listener attached if the repetition count is infinite. Provide an accessor so it will know. Change-Id: I481b048994a6e86ae88c913a5dcca3788b92bae2 Reviewed-on: https://skia-review.googlesource.com/99883 Reviewed-by: Derek Sollenberger <djsollen@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'tests/AnimatedImageTest.cpp')
-rw-r--r--tests/AnimatedImageTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/AnimatedImageTest.cpp b/tests/AnimatedImageTest.cpp
index cbbef2ddd2..95d7fc6d2e 100644
--- a/tests/AnimatedImageTest.cpp
+++ b/tests/AnimatedImageTest.cpp
@@ -82,6 +82,8 @@ DEF_TEST(AnimatedImage, r) {
continue;
}
+ REPORTER_ASSERT(r, defaultRepetitionCount == animatedImage->getRepetitionCount());
+
auto testDraw = [r, &frames, &imageInfo, file](const sk_sp<SkAnimatedImage>& animatedImage,
int expectedFrame) {
SkBitmap test;
@@ -216,6 +218,8 @@ DEF_TEST(AnimatedImage, r) {
SkCodec::MakeFromData(data)));
animatedImage->start();
animatedImage->setRepetitionCount(loopCount);
+ REPORTER_ASSERT(r, animatedImage->getRepetitionCount() == loopCount);
+
for (int loops = 0; loops <= loopCount; loops++) {
REPORTER_ASSERT(r, animatedImage->isRunning());
REPORTER_ASSERT(r, !animatedImage->isFinished());