diff options
author | Doris Liu <tianliu@google.com> | 2016-04-08 13:48:47 -0700 |
---|---|---|
committer | Doris Liu <tianliu@google.com> | 2016-04-12 17:32:21 -0700 |
commit | 32d7cda0b89a114171f14de0753674090b3d75fc (patch) | |
tree | f2dff922f8725319755c08828e416f1641050a68 /libs/hwui/tests/unit/VectorDrawableTests.cpp | |
parent | b6e1dafe78b2875ebe1837508e28c8dce2693b19 (diff) |
Fix translationY not being set correctly for VD during animation
Bug: 28056917
Change-Id: Ic5b7d14ac3dff8cad1c62f08b6d3389f979a2b00
Diffstat (limited to 'libs/hwui/tests/unit/VectorDrawableTests.cpp')
-rw-r--r-- | libs/hwui/tests/unit/VectorDrawableTests.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libs/hwui/tests/unit/VectorDrawableTests.cpp b/libs/hwui/tests/unit/VectorDrawableTests.cpp index 720854779c98..1678e191398b 100644 --- a/libs/hwui/tests/unit/VectorDrawableTests.cpp +++ b/libs/hwui/tests/unit/VectorDrawableTests.cpp @@ -389,5 +389,40 @@ TEST(VectorDrawable, matrixScale) { EXPECT_EQ(matrixAndScale.matrixScale, actualMatrixScale); } } + +TEST(VectorDrawable, groupProperties) { + //TODO: Also need to test property sync and dirty flag when properties change. + VectorDrawable::Group group; + VectorDrawable::Group::GroupProperties* properties = group.mutateProperties(); + // Test default values, change values through setters and verify the change through getters. + EXPECT_EQ(0.0f, properties->getTranslateX()); + properties->setTranslateX(1.0f); + EXPECT_EQ(1.0f, properties->getTranslateX()); + + EXPECT_EQ(0.0f, properties->getTranslateY()); + properties->setTranslateY(1.0f); + EXPECT_EQ(1.0f, properties->getTranslateY()); + + EXPECT_EQ(0.0f, properties->getRotation()); + properties->setRotation(1.0f); + EXPECT_EQ(1.0f, properties->getRotation()); + + EXPECT_EQ(1.0f, properties->getScaleX()); + properties->setScaleX(0.0f); + EXPECT_EQ(0.0f, properties->getScaleX()); + + EXPECT_EQ(1.0f, properties->getScaleY()); + properties->setScaleY(0.0f); + EXPECT_EQ(0.0f, properties->getScaleY()); + + EXPECT_EQ(0.0f, properties->getPivotX()); + properties->setPivotX(1.0f); + EXPECT_EQ(1.0f, properties->getPivotX()); + + EXPECT_EQ(0.0f, properties->getPivotY()); + properties->setPivotY(1.0f); + EXPECT_EQ(1.0f, properties->getPivotY()); + +} }; // namespace uirenderer }; // namespace android |