| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/paint/TextPainter.h" | 5 #include "core/paint/TextPainter.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
| 8 #include "core/CSSValueKeywords.h" | 9 #include "core/CSSValueKeywords.h" |
| 9 #include "core/css/CSSPrimitiveValue.h" | 10 #include "core/css/CSSPrimitiveValue.h" |
| 10 #include "core/frame/Settings.h" | 11 #include "core/frame/Settings.h" |
| 11 #include "core/layout/LayoutTestHelper.h" | 12 #include "core/layout/LayoutTestHelper.h" |
| 12 #include "core/layout/api/LineLayoutText.h" | 13 #include "core/layout/api/LineLayoutText.h" |
| 13 #include "core/paint/PaintInfo.h" | 14 #include "core/paint/PaintInfo.h" |
| 14 #include "core/style/ShadowData.h" | 15 #include "core/style/ShadowData.h" |
| 15 #include "core/style/ShadowList.h" | 16 #include "core/style/ShadowList.h" |
| 16 #include "platform/graphics/paint/PaintController.h" | 17 #include "platform/graphics/paint/PaintController.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include <memory> | |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 class TextPainterTest : public RenderingTest { | 23 class TextPainterTest : public RenderingTest { |
| 24 public: | 24 public: |
| 25 TextPainterTest() | 25 TextPainterTest() |
| 26 : m_layoutText(nullptr), | 26 : m_layoutText(nullptr), |
| 27 m_paintController(PaintController::create()), | 27 m_paintController(PaintController::create()), |
| 28 m_context(*m_paintController) {} | 28 m_context(*m_paintController) {} |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 TextPainter::Style textStyle = TextPainter::textPaintingStyle( | 156 TextPainter::Style textStyle = TextPainter::textPaintingStyle( |
| 157 getLineLayoutText(), getLineLayoutText().styleRef(), | 157 getLineLayoutText(), getLineLayoutText().styleRef(), |
| 158 createPaintInfo(false /* usesTextAsClip */, true /* isPrinting */)); | 158 createPaintInfo(false /* usesTextAsClip */, true /* isPrinting */)); |
| 159 EXPECT_EQ(Color(255, 220, 220).dark(), textStyle.fillColor); | 159 EXPECT_EQ(Color(255, 220, 220).dark(), textStyle.fillColor); |
| 160 EXPECT_EQ(Color(220, 255, 220).dark(), textStyle.strokeColor); | 160 EXPECT_EQ(Color(220, 255, 220).dark(), textStyle.strokeColor); |
| 161 EXPECT_EQ(Color(220, 220, 255).dark(), textStyle.emphasisMarkColor); | 161 EXPECT_EQ(Color(220, 220, 255).dark(), textStyle.emphasisMarkColor); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace | 164 } // namespace |
| 165 } // namespace blink | 165 } // namespace blink |
| OLD | NEW |