| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/LayoutTestHelper.h" | 5 #include "core/layout/LayoutTestHelper.h" |
| 6 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" | 6 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" |
| 7 #include "platform/testing/UnitTestHelpers.h" | 7 #include "platform/testing/UnitTestHelpers.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class TransformPaintPropertyNode; | 12 class TransformPaintPropertyNode; |
| 13 class ClipPaintPropertyNode; | 13 class ClipPaintPropertyNode; |
| 14 class ScrollPaintPropertyNode; | 14 class ScrollPaintPropertyNode; |
| 15 class LayoutPoint; | 15 class LayoutPoint; |
| 16 | 16 |
| 17 typedef bool TestParamRootLayerScrolling; | 17 typedef bool TestParamRootLayerScrolling; |
| 18 class PaintPropertyTreeBuilderTest | 18 class PaintPropertyTreeBuilderTest |
| 19 : public ::testing::WithParamInterface<TestParamRootLayerScrolling>, | 19 : public ::testing::WithParamInterface<TestParamRootLayerScrolling>, |
| 20 private ScopedSlimmingPaintV2ForTest, | 20 private ScopedSlimmingPaintV2ForTest, |
| 21 private ScopedRootLayerScrollingForTest, | 21 private ScopedRootLayerScrollingForTest, |
| 22 public RenderingTest { | 22 public RenderingTest { |
| 23 public: | 23 public: |
| 24 PaintPropertyTreeBuilderTest() | 24 PaintPropertyTreeBuilderTest() |
| 25 : ScopedSlimmingPaintV2ForTest(true), | 25 : ScopedSlimmingPaintV2ForTest(true), |
| 26 ScopedRootLayerScrollingForTest(GetParam()), | 26 ScopedRootLayerScrollingForTest(GetParam()), |
| 27 RenderingTest(SingleChildFrameLoaderClient::create()) {} | 27 RenderingTest(SingleChildLocalFrameClient::create()) {} |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 void loadTestData(const char* fileName); | 30 void loadTestData(const char* fileName); |
| 31 | 31 |
| 32 // The following helpers return paint property nodes associated with the main | 32 // The following helpers return paint property nodes associated with the main |
| 33 // FrameView, accounting for differences from the RootLayerScrolls setting. | 33 // FrameView, accounting for differences from the RootLayerScrolls setting. |
| 34 const TransformPaintPropertyNode* framePreTranslation(); | 34 const TransformPaintPropertyNode* framePreTranslation(); |
| 35 const TransformPaintPropertyNode* frameScrollTranslation(); | 35 const TransformPaintPropertyNode* frameScrollTranslation(); |
| 36 const ClipPaintPropertyNode* frameContentClip(); | 36 const ClipPaintPropertyNode* frameContentClip(); |
| 37 const ScrollPaintPropertyNode* frameScroll(FrameView* = nullptr); | 37 const ScrollPaintPropertyNode* frameScroll(FrameView* = nullptr); |
| 38 | 38 |
| 39 // Return the local border box's paint offset. For more details, see | 39 // Return the local border box's paint offset. For more details, see |
| 40 // ObjectPaintProperties::localBorderBoxProperties(). | 40 // ObjectPaintProperties::localBorderBoxProperties(). |
| 41 LayoutPoint paintOffset(const LayoutObject*); | 41 LayoutPoint paintOffset(const LayoutObject*); |
| 42 | 42 |
| 43 const ObjectPaintProperties* paintPropertiesForElement(const char* name); | 43 const ObjectPaintProperties* paintPropertiesForElement(const char* name); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 void SetUp() override; | 46 void SetUp() override; |
| 47 void TearDown() override; | 47 void TearDown() override; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace blink | 50 } // namespace blink |
| OLD | NEW |