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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp

Issue 2338373004: Refactor PropertyTreeState as GeometryPropertyTreeState (Closed)
Patch Set: Rebase 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
Index: third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp
deleted file mode 100644
index d816a4ec94fb8d17d66462b7c24cec889b3445b2..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/graphics/paint/PropertyTreeStateTest.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// 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 "platform/graphics/paint/PropertyTreeState.h"
-
-#include "platform/geometry/LayoutRect.h"
-#include "platform/graphics/paint/ClipPaintPropertyNode.h"
-#include "platform/graphics/paint/EffectPaintPropertyNode.h"
-#include "platform/graphics/paint/TransformPaintPropertyNode.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace blink {
-
-class PropertyTreeStateTest : public ::testing::Test {
-public:
- RefPtr<TransformPaintPropertyNode> rootTransformNode;
- RefPtr<ClipPaintPropertyNode> rootClipNode;
- RefPtr<EffectPaintPropertyNode> rootEffectNode;
-
- PropertyTreeState rootPropertyTreeState()
- {
- PropertyTreeState state(rootTransformNode.get(), rootClipNode.get(), rootEffectNode.get());
- return state;
- }
-
-private:
- void SetUp() override
- {
- rootTransformNode = TransformPaintPropertyNode::create(nullptr, TransformationMatrix(), FloatPoint3D());
- rootClipNode = ClipPaintPropertyNode::create(nullptr, rootTransformNode, FloatRoundedRect(LayoutRect::infiniteIntRect()));
- rootEffectNode = EffectPaintPropertyNode::create(nullptr, 1.0);
- }
-};
-
-TEST_F(PropertyTreeStateTest, LeastCommonAncestor)
-{
- TransformationMatrix matrix;
- RefPtr<TransformPaintPropertyNode> child1 = TransformPaintPropertyNode::create(rootPropertyTreeState().transform, matrix, FloatPoint3D());
- RefPtr<TransformPaintPropertyNode> child2 = TransformPaintPropertyNode::create(rootPropertyTreeState().transform, matrix, FloatPoint3D());
-
- RefPtr<TransformPaintPropertyNode> childOfChild1 = TransformPaintPropertyNode::create(child1, matrix, FloatPoint3D());
- RefPtr<TransformPaintPropertyNode> childOfChild2 = TransformPaintPropertyNode::create(child2, matrix, FloatPoint3D());
-
- EXPECT_EQ(rootPropertyTreeState().transform, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(childOfChild1.get(), childOfChild2.get()));
- EXPECT_EQ(rootPropertyTreeState().transform, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(childOfChild1.get(), child2.get()));
- EXPECT_EQ(rootPropertyTreeState().transform, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(childOfChild1.get(), rootPropertyTreeState().transform.get()));
- EXPECT_EQ(child1, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(childOfChild1.get(), child1.get()));
-
- EXPECT_EQ(rootPropertyTreeState().transform, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(childOfChild2.get(), childOfChild1.get()));
- EXPECT_EQ(rootPropertyTreeState().transform, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(childOfChild2.get(), child1.get()));
- EXPECT_EQ(rootPropertyTreeState().transform, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(childOfChild2.get(), rootPropertyTreeState().transform.get()));
- EXPECT_EQ(child2, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(childOfChild2.get(), child2.get()));
-
- EXPECT_EQ(rootPropertyTreeState().transform, propertyTreeNearestCommonAncestor<TransformPaintPropertyNode>(child1.get(), child2.get()));
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698