| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/css/resolver/FontBuilder.h" | 6 #include "core/css/resolver/FontBuilder.h" |
| 7 #include "core/rendering/style/RenderStyle.h" |
| 7 #include "core/testing/DummyPageHolder.h" | 8 #include "core/testing/DummyPageHolder.h" |
| 8 | 9 |
| 9 #include <gtest/gtest.h> | 10 #include <gtest/gtest.h> |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 class FontBuilderTest : public ::testing::Test { | 14 class FontBuilderTest : public ::testing::Test { |
| 14 protected: | 15 protected: |
| 15 RenderStyle* getStyle(const FontBuilder& builder) | 16 RenderStyle* getStyle(const FontBuilder& builder) |
| 16 { | 17 { |
| 17 return builder.m_style; | 18 return builder.m_style; |
| 18 } | 19 } |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 TEST_F(FontBuilderTest, StylePointerInitialisation) | 22 TEST_F(FontBuilderTest, StylePointerInitialisation) |
| 22 { | 23 { |
| 23 OwnPtr<DummyPageHolder> dummy = DummyPageHolder::create(IntSize(800, 600)); | 24 OwnPtr<DummyPageHolder> dummy = DummyPageHolder::create(IntSize(800, 600)); |
| 24 FontBuilder builder(dummy->document()); | 25 RefPtr<RenderStyle> style = RenderStyle::create(); |
| 25 EXPECT_EQ(0, getStyle(builder)); | 26 FontBuilder builder(dummy->document(), style.get()); |
| 27 EXPECT_EQ(style.get(), getStyle(builder)); |
| 26 } | 28 } |
| 27 | 29 |
| 28 } // namespace blink | 30 } // namespace blink |
| OLD | NEW |