Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Unified Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp

Issue 2596623002: Create compositor animations for effect animations in SPv2. (Closed)
Patch Set: Add unit tests. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
index 1a5246a571729a035d5309aa0265981fd1790295..ab928fe7a5263229d9b782b2ab0e6bc811567693 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp
@@ -403,30 +403,44 @@ TEST_P(PaintPropertyTreeBuilderTest,
EXPECT_TRUE(transformProperties->transform()->hasDirectCompositingReasons());
}
+namespace {
+
+const char* kSimpleOpacityExampleHTML =
+ "<style>"
+ "div {"
+ " width: 100px;"
+ " height: 100px;"
+ " background-color: red;"
+ " animation-name: example;"
+ " animation-duration: 4s;"
+ "}"
+ "@keyframes example {"
+ " from { opacity: 0.0;}"
+ " to { opacity: 1.0;}"
+ "}"
+ "</style>"
+ "<div id='target'></div>";
+
+} // namespace
+
TEST_P(PaintPropertyTreeBuilderTest,
OpacityAnimationDoesNotCreateTransformNode) {
- setBodyInnerHTML(
- "<style>"
- "div {"
- " width: 100px;"
- " height: 100px;"
- " background-color: red;"
- " animation-name: example;"
- " animation-duration: 4s;"
- "}"
- "@keyframes example {"
- " from { opacity: 0.0;}"
- " to { opacity: 1.0;}"
- "}"
- "</style>"
- "<div id='target'></div>");
-
+ setBodyInnerHTML(kSimpleOpacityExampleHTML);
Element* target = document().getElementById("target");
const ObjectPaintProperties* properties =
target->layoutObject()->paintProperties();
EXPECT_EQ(nullptr, properties->transform());
}
+TEST_P(PaintPropertyTreeBuilderTest,
+ EffectNodeWithActiveAnimationHasDirectCompositingReason) {
+ setBodyInnerHTML(kSimpleOpacityExampleHTML);
+ Element* target = document().getElementById("target");
+ const ObjectPaintProperties* properties =
+ target->layoutObject()->paintProperties();
+ EXPECT_TRUE(properties->effect()->hasDirectCompositingReasons());
+}
+
TEST_P(PaintPropertyTreeBuilderTest, WillChangeTransform) {
setBodyInnerHTML(
"<style> body { margin: 0 } </style>"

Powered by Google App Engine
This is Rietveld 408576698