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

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

Issue 2377183002: Add paint property path printers and test them (Closed)
Patch Set: Created 4 years, 3 months 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
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp
index de04f7114cbe66abdc5a2b054add0ad2cbbf8435..ee82f213ee56f795722b5d55f663548ef61cd28d 100644
--- a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp
@@ -4,6 +4,7 @@
#include "core/paint/PaintPropertyTreePrinter.h"
+#include "core/layout/LayoutObject.h"
#include "core/layout/LayoutTestHelper.h"
#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
@@ -80,6 +81,55 @@ TEST_P(PaintPropertyTreePrinterTest, SimpleScrollTree)
" Scroll \\(.*\\) .*"));
}
+TEST_P(PaintPropertyTreePrinterTest, SimpleTransformTreePath)
+{
+ setBodyInnerHTML("<div id='transform' style='transform: translate3d(10px, 10px, 0px);'></div>");
+ LayoutObject* transformedObject = document().getElementById("transform")->layoutObject();
+ const ObjectPaintProperties* transformedObjectProperties = transformedObject->objectPaintProperties();
+ String transformPathAsString = transformPaintPropertyPathAsString(transformedObjectProperties->transform());
+ EXPECT_THAT(transformPathAsString.ascii().data(),
+ testing::MatchesRegex("root .* transform.*"
+ " .* transform.*"
+ " .* transform.*"
+ " .* transform.*"));
+}
+
+TEST_P(PaintPropertyTreePrinterTest, SimpleClipTreePath)
+{
+ setBodyInnerHTML("<div id='clip' style='position: absolute; clip: rect(10px, 80px, 70px, 40px);'></div>");
+ LayoutObject* clippedObject = document().getElementById("clip")->layoutObject();
+ const ObjectPaintProperties* clippedObjectProperties = clippedObject->objectPaintProperties();
+ String clipPathAsString = clipPaintPropertyPathAsString(clippedObjectProperties->cssClip());
+ EXPECT_THAT(clipPathAsString.ascii().data(),
+ testing::MatchesRegex("root .* rect.*"
+ " .* rect.*"
+ " .* rect.*"));
+}
+
+TEST_P(PaintPropertyTreePrinterTest, SimpleEffectTreePath)
+{
+ setBodyInnerHTML("<div id='effect' style='opacity: 0.9;'></div>");
+ LayoutObject* effectObject = document().getElementById("effect")->layoutObject();
+ const ObjectPaintProperties* effectObjectProperties = effectObject->objectPaintProperties();
+ String effectPathAsString = effectPaintPropertyPathAsString(effectObjectProperties->effect());
+ EXPECT_THAT(effectPathAsString.ascii().data(),
+ testing::MatchesRegex("root .* opacity.*"
+ " .* opacity.*"));
+}
+
+TEST_P(PaintPropertyTreePrinterTest, SimpleScrollTreePath)
+{
+ setBodyInnerHTML("<div id='scroll' style='overflow: scroll; height: 100px;'>"
+ " <div id='forceScroll' style='height: 4000px;'></div>"
+ "</div>");
+ LayoutObject* scrollObject = document().getElementById("scroll")->layoutObject();
+ const ObjectPaintProperties* scrollObjectProperties = scrollObject->objectPaintProperties();
+ String scrollPathAsString = scrollPaintPropertyPathAsString(scrollObjectProperties->scroll());
+ EXPECT_THAT(scrollPathAsString.ascii().data(),
+ testing::MatchesRegex("root .* scroll.*"
+ " .* scroll.*"));
+}
+
} // namespace blink
#endif
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPropertyTreePrinter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698