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

Side by Side Diff: Source/core/paint/TextPainterTest.cpp

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "config.h" 5 #include "config.h"
6 #include "core/paint/TextPainter.h" 6 #include "core/paint/TextPainter.h"
7 7
8 #include "core/CSSPropertyNames.h" 8 #include "core/CSSPropertyNames.h"
9 #include "core/CSSValueKeywords.h" 9 #include "core/CSSValueKeywords.h"
10 #include "core/css/CSSPrimitiveValue.h" 10 #include "core/css/CSSPrimitiveValue.h"
(...skipping 12 matching lines...) Expand all
23 TextPainterTest() : m_renderText(nullptr) { } 23 TextPainterTest() : m_renderText(nullptr) { }
24 24
25 protected: 25 protected:
26 LayoutText* renderText() { return m_renderText; } 26 LayoutText* renderText() { return m_renderText; }
27 27
28 private: 28 private:
29 virtual void SetUp() override 29 virtual void SetUp() override
30 { 30 {
31 RenderingTest::SetUp(); 31 RenderingTest::SetUp();
32 setBodyInnerHTML("Hello world"); 32 setBodyInnerHTML("Hello world");
33 m_renderText = toLayoutText(document().body()->firstChild()->renderer()) ; 33 m_renderText = toLayoutText(document().body()->firstChild()->layoutObjec t());
34 ASSERT_TRUE(m_renderText); 34 ASSERT_TRUE(m_renderText);
35 ASSERT_EQ("Hello world", m_renderText->text()); 35 ASSERT_EQ("Hello world", m_renderText->text());
36 } 36 }
37 37
38 LayoutText* m_renderText; 38 LayoutText* m_renderText;
39 }; 39 };
40 40
41 TEST_F(TextPainterTest, TextPaintingStyle_Simple) 41 TEST_F(TextPainterTest, TextPaintingStyle_Simple)
42 { 42 {
43 document().body()->setInlineStyleProperty(CSSPropertyColor, CSSValueBlue); 43 document().body()->setInlineStyleProperty(CSSPropertyColor, CSSValueBlue);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 TextPainter::Style textStyle = TextPainter::textPaintingStyle( 121 TextPainter::Style textStyle = TextPainter::textPaintingStyle(
122 *renderText(), renderText()->styleRef(), false /* forceBlackText */, tru e /* isPrinting */); 122 *renderText(), renderText()->styleRef(), false /* forceBlackText */, tru e /* isPrinting */);
123 EXPECT_EQ(Color(255, 220, 220).dark(), textStyle.fillColor); 123 EXPECT_EQ(Color(255, 220, 220).dark(), textStyle.fillColor);
124 EXPECT_EQ(Color(220, 255, 220).dark(), textStyle.strokeColor); 124 EXPECT_EQ(Color(220, 255, 220).dark(), textStyle.strokeColor);
125 EXPECT_EQ(Color(220, 220, 255).dark(), textStyle.emphasisMarkColor); 125 EXPECT_EQ(Color(220, 220, 255).dark(), textStyle.emphasisMarkColor);
126 } 126 }
127 127
128 } // namespace 128 } // namespace
129 } // namespace blink 129 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/SVGRootInlineBoxPainter.cpp ('k') | Source/core/paint/ViewDisplayListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698