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/css/resolver/FontBuilder.h" | 5 #include "core/css/resolver/FontBuilder.h" |
6 | 6 |
7 #include "core/css/CSSFontSelector.h" | 7 #include "core/css/CSSFontSelector.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/dom/StyleEngine.h" | 9 #include "core/dom/StyleEngine.h" |
10 #include "core/frame/Settings.h" | 10 #include "core/frame/Settings.h" |
11 #include "core/style/ComputedStyle.h" | 11 #include "core/style/ComputedStyle.h" |
12 #include "core/testing/DummyPageHolder.h" | 12 #include "core/testing/DummyPageHolder.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include <memory> |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class FontBuilderTest { | 18 class FontBuilderTest { |
18 public: | 19 public: |
19 FontBuilderTest() | 20 FontBuilderTest() |
20 : m_dummy(DummyPageHolder::create(IntSize(800, 600))) | 21 : m_dummy(DummyPageHolder::create(IntSize(800, 600))) |
21 { | 22 { |
22 settings().setDefaultFontSize(16.0f); | 23 settings().setDefaultFontSize(16.0f); |
23 } | 24 } |
24 | 25 |
25 Document& document() { return m_dummy->document(); } | 26 Document& document() { return m_dummy->document(); } |
26 Settings& settings() { return *document().settings(); } | 27 Settings& settings() { return *document().settings(); } |
27 | 28 |
28 private: | 29 private: |
29 OwnPtr<DummyPageHolder> m_dummy; | 30 std::unique_ptr<DummyPageHolder> m_dummy; |
30 }; | 31 }; |
31 | 32 |
32 using BuilderFunc = void (*)(FontBuilder&); | 33 using BuilderFunc = void (*)(FontBuilder&); |
33 using DescriptionFunc = void (*)(FontDescription&); | 34 using DescriptionFunc = void (*)(FontDescription&); |
34 | 35 |
35 struct FunctionPair { | 36 struct FunctionPair { |
36 FunctionPair(DescriptionFunc base, BuilderFunc value) | 37 FunctionPair(DescriptionFunc base, BuilderFunc value) |
37 : setBaseValue(base) | 38 : setBaseValue(base) |
38 , setValue(value) | 39 , setValue(value) |
39 { | 40 { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 FunctionPair(fontVariantCapsBase, fontVariantCapsValue), | 163 FunctionPair(fontVariantCapsBase, fontVariantCapsValue), |
163 FunctionPair(fontVariantLigaturesBase, fontVariantLigaturesValue), | 164 FunctionPair(fontVariantLigaturesBase, fontVariantLigaturesValue), |
164 FunctionPair(fontVariantNumericBase, fontVariantNumericValue), | 165 FunctionPair(fontVariantNumericBase, fontVariantNumericValue), |
165 FunctionPair(fontTextRenderingBase, fontTextRenderingValue), | 166 FunctionPair(fontTextRenderingBase, fontTextRenderingValue), |
166 FunctionPair(fontKerningBase, fontKerningValue), | 167 FunctionPair(fontKerningBase, fontKerningValue), |
167 FunctionPair(fontFontSmoothingBase, fontFontSmoothingValue), | 168 FunctionPair(fontFontSmoothingBase, fontFontSmoothingValue), |
168 FunctionPair(fontSizeBase, fontSizeValue), | 169 FunctionPair(fontSizeBase, fontSizeValue), |
169 FunctionPair(fontScriptBase, fontScriptValue))); | 170 FunctionPair(fontScriptBase, fontScriptValue))); |
170 | 171 |
171 } // namespace blink | 172 } // namespace blink |
OLD | NEW |