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

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

Issue 2373093002: (reland) Add tests for PaintPropertyTreePrinter, remove path printers (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
new file mode 100644
index 0000000000000000000000000000000000000000..de04f7114cbe66abdc5a2b054add0ad2cbbf8435
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp
@@ -0,0 +1,85 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/paint/PaintPropertyTreePrinter.h"
+
+#include "core/layout/LayoutTestHelper.h"
+#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
+#include "testing/gmock/include/gmock/gmock-matchers.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#ifndef NDEBUG
+
+namespace blink {
+
+typedef bool TestParamRootLayerScrolling;
+class PaintPropertyTreePrinterTest
+ : public ::testing::WithParamInterface<TestParamRootLayerScrolling>
+ , private ScopedSlimmingPaintV2ForTest
+ , private ScopedRootLayerScrollingForTest
+ , public RenderingTest {
+public:
+ PaintPropertyTreePrinterTest()
+ : ScopedSlimmingPaintV2ForTest(true)
+ , ScopedRootLayerScrollingForTest(GetParam())
+ , RenderingTest(SingleChildFrameLoaderClient::create()) { }
+
+private:
+ void SetUp() override
+ {
+ Settings::setMockScrollbarsEnabled(true);
+
+ RenderingTest::SetUp();
+ enableCompositing();
+ }
+
+ void TearDown() override
+ {
+ RenderingTest::TearDown();
+
+ Settings::setMockScrollbarsEnabled(false);
+ }
+};
+
+INSTANTIATE_TEST_CASE_P(All, PaintPropertyTreePrinterTest, ::testing::Bool());
+
+TEST_P(PaintPropertyTreePrinterTest, SimpleTransformTree)
+{
+ setBodyInnerHTML("hello world");
+ String transformTreeAsString = transformPropertyTreeAsString(*document().view());
+ EXPECT_THAT(transformTreeAsString.ascii().data(),
+ testing::MatchesRegex("root .*"
+ " .*Translation \\(.*\\) .*"));
+}
+
+TEST_P(PaintPropertyTreePrinterTest, SimpleClipTree)
+{
+ setBodyInnerHTML("hello world");
+ String clipTreeAsString = clipPropertyTreeAsString(*document().view());
+ EXPECT_THAT(clipTreeAsString.ascii().data(),
+ testing::MatchesRegex("root .*"
+ " .*Clip \\(.*\\) .*"));
+}
+
+TEST_P(PaintPropertyTreePrinterTest, SimpleEffectTree)
+{
+ setBodyInnerHTML("<div style='opacity: 0.9;'>hello world</div>");
+ String effectTreeAsString = effectPropertyTreeAsString(*document().view());
+ EXPECT_THAT(effectTreeAsString.ascii().data(),
+ testing::MatchesRegex("root .*"
+ " Effect \\(LayoutBlockFlow DIV\\) .*"));
+}
+
+TEST_P(PaintPropertyTreePrinterTest, SimpleScrollTree)
+{
+ setBodyInnerHTML("<div style='height: 4000px;'>hello world</div>");
+ String scrollTreeAsString = scrollPropertyTreeAsString(*document().view());
+ EXPECT_THAT(scrollTreeAsString.ascii().data(),
+ testing::MatchesRegex("root .*"
+ " 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