OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/layout/LayoutTreeAsText.h" | 6 #include "core/layout/LayoutTreeAsText.h" |
7 #include "core/layout/LayoutView.h" | 7 #include "core/layout/LayoutView.h" |
8 #include "core/paint/ObjectPaintProperties.h" | 8 #include "core/paint/ObjectPaintProperties.h" |
9 #include "platform/graphics/paint/TransformPaintPropertyNode.h" | 9 #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
10 #include "platform/testing/UnitTestHelpers.h" | 10 #include "platform/testing/UnitTestHelpers.h" |
11 #include "platform/text/TextStream.h" | 11 #include "platform/text/TextStream.h" |
12 #include "public/platform/Platform.h" | |
13 #include "public/platform/WebUnitTestSupport.h" | |
14 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "wtf/HashMap.h" | 13 #include "wtf/HashMap.h" |
16 #include "wtf/Vector.h" | 14 #include "wtf/Vector.h" |
17 | 15 |
18 namespace blink { | 16 namespace blink { |
19 | 17 |
20 class PaintPropertyTreeBuilderTest : public RenderingTest { | 18 class PaintPropertyTreeBuilderTest : public RenderingTest { |
21 public: | 19 public: |
22 PaintPropertyTreeBuilderTest() | 20 PaintPropertyTreeBuilderTest() |
23 : m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint
V2Enabled()) { } | 21 : m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaint
V2Enabled()) { } |
24 | 22 |
25 void loadTestData(const char* fileName) | 23 void loadTestData(const char* fileName) |
26 { | 24 { |
27 String fullPath = testing::blinkRootDir(); | 25 String fullPath = testing::blinkRootDir(); |
28 fullPath.append("/Source/core/paint/test_data/"); | 26 fullPath.append("/Source/core/paint/test_data/"); |
29 fullPath.append(fileName); | 27 fullPath.append(fileName); |
30 WebData inputBuffer = Platform::current()->unitTestSupport()->readFromFi
le(fullPath); | 28 RefPtr<SharedBuffer> inputBuffer = testing::readFromFile(fullPath); |
31 setBodyInnerHTML(String(inputBuffer.data(), inputBuffer.size())); | 29 setBodyInnerHTML(String(inputBuffer->data(), inputBuffer->size())); |
32 } | 30 } |
33 | 31 |
34 private: | 32 private: |
35 void SetUp() override | 33 void SetUp() override |
36 { | 34 { |
37 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true); | 35 RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true); |
38 Settings::setMockScrollbarsEnabled(true); | 36 Settings::setMockScrollbarsEnabled(true); |
39 | 37 |
40 RenderingTest::SetUp(); | 38 RenderingTest::SetUp(); |
41 enableCompositing(); | 39 enableCompositing(); |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 FloatRect(60, 45, 500, 400), // = border box(610, 500) - border outs
et(110, 100) | 548 FloatRect(60, 45, 500, 400), // = border box(610, 500) - border outs
et(110, 100) |
551 FloatSize(0, 0), // (top left) = max((12, 12) - (60, 45), (0,
0)) | 549 FloatSize(0, 0), // (top left) = max((12, 12) - (60, 45), (0,
0)) |
552 FloatSize(0, 0), // (top right) = max((34, 34) - (50, 45), (0,
0)) | 550 FloatSize(0, 0), // (top right) = max((34, 34) - (50, 45), (0,
0)) |
553 FloatSize(18, 23), // (bottom left) = max((78, 78) - (60, 55), (0,
0)) | 551 FloatSize(18, 23), // (bottom left) = max((78, 78) - (60, 55), (0,
0)) |
554 FloatSize(6, 1)), // (bottom right) = max((56, 56) - (50, 55), (0,
0)) | 552 FloatSize(6, 1)), // (bottom right) = max((56, 56) - (50, 55), (0,
0)) |
555 borderRadiusClip->clipRect()); | 553 borderRadiusClip->clipRect()); |
556 EXPECT_EQ(frameView->contentClip(), borderRadiusClip->parent()); | 554 EXPECT_EQ(frameView->contentClip(), borderRadiusClip->parent()); |
557 } | 555 } |
558 | 556 |
559 } // namespace blink | 557 } // namespace blink |
OLD | NEW |