OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/gfx/render_text.h" | 5 #include "ui/gfx/render_text.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 #include "third_party/skia/include/core/SkRefCnt.h" | 25 #include "third_party/skia/include/core/SkRefCnt.h" |
26 #include "third_party/skia/include/core/SkSurface.h" | 26 #include "third_party/skia/include/core/SkSurface.h" |
27 #include "third_party/skia/include/core/SkTypeface.h" | 27 #include "third_party/skia/include/core/SkTypeface.h" |
28 #include "ui/gfx/break_list.h" | 28 #include "ui/gfx/break_list.h" |
29 #include "ui/gfx/canvas.h" | 29 #include "ui/gfx/canvas.h" |
30 #include "ui/gfx/color_utils.h" | 30 #include "ui/gfx/color_utils.h" |
| 31 #include "ui/gfx/decorated_text.h" |
31 #include "ui/gfx/font.h" | 32 #include "ui/gfx/font.h" |
32 #include "ui/gfx/font_names_testing.h" | 33 #include "ui/gfx/font_names_testing.h" |
33 #include "ui/gfx/geometry/point.h" | 34 #include "ui/gfx/geometry/point.h" |
34 #include "ui/gfx/geometry/point_f.h" | 35 #include "ui/gfx/geometry/point_f.h" |
35 #include "ui/gfx/range/range.h" | 36 #include "ui/gfx/range/range.h" |
36 #include "ui/gfx/range/range_f.h" | 37 #include "ui/gfx/range/range_f.h" |
37 #include "ui/gfx/render_text_harfbuzz.h" | 38 #include "ui/gfx/render_text_harfbuzz.h" |
38 #include "ui/gfx/text_utils.h" | 39 #include "ui/gfx/text_utils.h" |
39 | 40 |
40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 147 |
147 // Various weak, LTR, RTL, and Bidi string cases with three characters each. | 148 // Various weak, LTR, RTL, and Bidi string cases with three characters each. |
148 const wchar_t kWeak[] = L" . "; | 149 const wchar_t kWeak[] = L" . "; |
149 const wchar_t kLtr[] = L"abc"; | 150 const wchar_t kLtr[] = L"abc"; |
150 const wchar_t kRtl[] = L"\x5d0\x5d1\x5d2"; | 151 const wchar_t kRtl[] = L"\x5d0\x5d1\x5d2"; |
151 const wchar_t kLtrRtl[] = L"a" L"\x5d0\x5d1"; | 152 const wchar_t kLtrRtl[] = L"a" L"\x5d0\x5d1"; |
152 const wchar_t kLtrRtlLtr[] = L"a" L"\x5d1" L"b"; | 153 const wchar_t kLtrRtlLtr[] = L"a" L"\x5d1" L"b"; |
153 const wchar_t kRtlLtr[] = L"\x5d0\x5d1" L"a"; | 154 const wchar_t kRtlLtr[] = L"\x5d0\x5d1" L"a"; |
154 const wchar_t kRtlLtrRtl[] = L"\x5d0" L"a" L"\x5d1"; | 155 const wchar_t kRtlLtrRtl[] = L"\x5d0" L"a" L"\x5d1"; |
155 | 156 |
| 157 // Bitmasks based on gfx::TextStyle. |
| 158 enum { |
| 159 ITALIC_MASK = 1 << ITALIC, |
| 160 STRIKE_MASK = 1 << STRIKE, |
| 161 DIAGONAL_STRIKE_MASK = 1 << DIAGONAL_STRIKE, |
| 162 UNDERLINE_MASK = 1 << UNDERLINE, |
| 163 }; |
| 164 |
156 // Checks whether |range| contains |index|. This is not the same as calling | 165 // Checks whether |range| contains |index|. This is not the same as calling |
157 // range.Contains(Range(index)), which returns true if |index| == |range.end()|. | 166 // range.Contains(Range(index)), which returns true if |index| == |range.end()|. |
158 bool IndexInRange(const Range& range, size_t index) { | 167 bool IndexInRange(const Range& range, size_t index) { |
159 return index >= range.start() && index < range.end(); | 168 return index >= range.start() && index < range.end(); |
160 } | 169 } |
161 | 170 |
162 base::string16 GetSelectedText(RenderText* render_text) { | 171 base::string16 GetSelectedText(RenderText* render_text) { |
163 return render_text->text().substr(render_text->selection().GetMin(), | 172 return render_text->text().substr(render_text->selection().GetMin(), |
164 render_text->selection().length()); | 173 render_text->selection().length()); |
165 } | 174 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 EXPECT_EQ(expected[i], render_text->selection_model()); | 209 EXPECT_EQ(expected[i], render_text->selection_model()); |
201 render_text->MoveCursor(CHARACTER_BREAK, direction, SELECTION_NONE); | 210 render_text->MoveCursor(CHARACTER_BREAK, direction, SELECTION_NONE); |
202 } | 211 } |
203 // Check that cursoring is clamped at the line edge. | 212 // Check that cursoring is clamped at the line edge. |
204 EXPECT_EQ(expected.back(), render_text->selection_model()); | 213 EXPECT_EQ(expected.back(), render_text->selection_model()); |
205 // Check that it is the line edge. | 214 // Check that it is the line edge. |
206 render_text->MoveCursor(LINE_BREAK, direction, SELECTION_NONE); | 215 render_text->MoveCursor(LINE_BREAK, direction, SELECTION_NONE); |
207 EXPECT_EQ(expected.back(), render_text->selection_model()); | 216 EXPECT_EQ(expected.back(), render_text->selection_model()); |
208 } | 217 } |
209 | 218 |
| 219 // Creates a RangedAttribute instance for a single character range at the |
| 220 // given |index| with the given |weight| and |style_mask|. |index| is the |
| 221 // index of the character in the DecoratedText instance and |font_index| is |
| 222 // used to retrieve the font used from |font_spans|. |
| 223 DecoratedText::RangedAttribute CreateRangedAttribute( |
| 224 const std::vector<RenderText::FontSpan>& font_spans, |
| 225 int index, |
| 226 int font_index, |
| 227 Font::Weight weight, |
| 228 int style_mask) { |
| 229 const auto iter = |
| 230 std::find_if(font_spans.begin(), font_spans.end(), |
| 231 [font_index](const RenderText::FontSpan& span) { |
| 232 return IndexInRange(span.second, font_index); |
| 233 }); |
| 234 DCHECK(font_spans.end() != iter); |
| 235 const Font& font = iter->first; |
| 236 |
| 237 int font_style = Font::NORMAL; |
| 238 if (style_mask & ITALIC_MASK) |
| 239 font_style |= Font::ITALIC; |
| 240 if (style_mask & UNDERLINE_MASK) |
| 241 font_style |= Font::UNDERLINE; |
| 242 |
| 243 const Font font_with_style = font.Derive(0, font_style, weight); |
| 244 DecoratedText::RangedAttribute attributes(Range(index, index + 1), |
| 245 font_with_style); |
| 246 attributes.strike = style_mask & STRIKE_MASK; |
| 247 attributes.diagonal_strike = style_mask & DIAGONAL_STRIKE_MASK; |
| 248 return attributes; |
| 249 } |
| 250 |
| 251 // Verifies the given DecoratedText instances are equal by comparing the |
| 252 // respective strings and attributes for each index. Note, corresponding |
| 253 // ranged attributes from |expected| and |actual| can't be compared since the |
| 254 // partition of |actual| into RangedAttributes will depend on the text runs |
| 255 // generated. |
| 256 void VerifyDecoratedWordsAreEqual(const DecoratedText& expected, |
| 257 const DecoratedText& actual) { |
| 258 ASSERT_EQ(expected.text, actual.text); |
| 259 |
| 260 // Compare attributes for each index. |
| 261 for (size_t i = 0; i < expected.text.length(); i++) { |
| 262 SCOPED_TRACE(base::StringPrintf("Comparing index[%" PRIuS "]", i)); |
| 263 auto find_attribute_func = [i](const DecoratedText::RangedAttribute& attr) { |
| 264 return IndexInRange(attr.range, i); |
| 265 }; |
| 266 const auto expected_attr = |
| 267 std::find_if(expected.attributes.begin(), expected.attributes.end(), |
| 268 find_attribute_func); |
| 269 const auto actual_attr = |
| 270 std::find_if(actual.attributes.begin(), actual.attributes.end(), |
| 271 find_attribute_func); |
| 272 ASSERT_NE(expected.attributes.end(), expected_attr); |
| 273 ASSERT_NE(actual.attributes.end(), actual_attr); |
| 274 |
| 275 EXPECT_EQ(expected_attr->strike, actual_attr->strike); |
| 276 EXPECT_EQ(expected_attr->diagonal_strike, actual_attr->diagonal_strike); |
| 277 EXPECT_EQ(expected_attr->font.GetFontName(), |
| 278 actual_attr->font.GetFontName()); |
| 279 EXPECT_EQ(expected_attr->font.GetFontSize(), |
| 280 actual_attr->font.GetFontSize()); |
| 281 EXPECT_EQ(expected_attr->font.GetWeight(), actual_attr->font.GetWeight()); |
| 282 EXPECT_EQ(expected_attr->font.GetStyle(), actual_attr->font.GetStyle()); |
| 283 } |
| 284 } |
| 285 |
210 // The class which records the drawing operations so that the test case can | 286 // The class which records the drawing operations so that the test case can |
211 // verify where exactly the glyphs are drawn. | 287 // verify where exactly the glyphs are drawn. |
212 class TestSkiaTextRenderer : public internal::SkiaTextRenderer { | 288 class TestSkiaTextRenderer : public internal::SkiaTextRenderer { |
213 public: | 289 public: |
214 struct TextLog { | 290 struct TextLog { |
215 TextLog() : glyph_count(0u), color(SK_ColorTRANSPARENT) {} | 291 TextLog() : glyph_count(0u), color(SK_ColorTRANSPARENT) {} |
216 PointF origin; | 292 PointF origin; |
217 size_t glyph_count; | 293 size_t glyph_count; |
218 SkColor color; | 294 SkColor color; |
219 }; | 295 }; |
(...skipping 3559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3779 // SUBPIXEL_RENDERING_RGB set above should now take effect. But, after | 3855 // SUBPIXEL_RENDERING_RGB set above should now take effect. But, after |
3780 // checking, apply the override anyway to be explicit that it is suppressed. | 3856 // checking, apply the override anyway to be explicit that it is suppressed. |
3781 EXPECT_FALSE(GetRendererPaint().isLCDRenderText()); | 3857 EXPECT_FALSE(GetRendererPaint().isLCDRenderText()); |
3782 GetHarfBuzzRunList()->runs()[0]->render_params.subpixel_rendering = | 3858 GetHarfBuzzRunList()->runs()[0]->render_params.subpixel_rendering = |
3783 FontRenderParams::SUBPIXEL_RENDERING_RGB; | 3859 FontRenderParams::SUBPIXEL_RENDERING_RGB; |
3784 DrawVisualText(); | 3860 DrawVisualText(); |
3785 #endif | 3861 #endif |
3786 EXPECT_FALSE(GetRendererPaint().isLCDRenderText()); | 3862 EXPECT_FALSE(GetRendererPaint().isLCDRenderText()); |
3787 } | 3863 } |
3788 | 3864 |
| 3865 // Verify GetDecoratedWordAtPoint returns the correct baseline point and |
| 3866 // decorated word for an LTR string. |
| 3867 TEST_P(RenderTextHarfBuzzTest, GetDecoratedWordAtPoint_LTR) { |
| 3868 const base::string16 ltr = ASCIIToUTF16(" ab c "); |
| 3869 const int kWordOneStartIndex = 2; |
| 3870 const int kWordTwoStartIndex = 6; |
| 3871 |
| 3872 RenderText* render_text = GetRenderText(); |
| 3873 render_text->SetDisplayRect(Rect(100, 30)); |
| 3874 render_text->SetText(ltr); |
| 3875 render_text->ApplyWeight(Font::Weight::SEMIBOLD, Range(0, 3)); |
| 3876 render_text->ApplyStyle(UNDERLINE, true, Range(1, 5)); |
| 3877 render_text->ApplyStyle(ITALIC, true, Range(3, 8)); |
| 3878 render_text->ApplyStyle(DIAGONAL_STRIKE, true, Range(5, 7)); |
| 3879 render_text->ApplyStyle(STRIKE, true, Range(1, 7)); |
| 3880 |
| 3881 const std::vector<RenderText::FontSpan> font_spans = |
| 3882 render_text->GetFontSpansForTesting(); |
| 3883 |
| 3884 // Create expected decorated text instances. |
| 3885 DecoratedText expected_word_1; |
| 3886 expected_word_1.text = ASCIIToUTF16("ab"); |
| 3887 // Attributes for the characters 'a' and 'b' at logical indices 2 and 3 |
| 3888 // respectively. |
| 3889 expected_word_1.attributes.push_back(CreateRangedAttribute( |
| 3890 font_spans, 0, kWordOneStartIndex, Font::Weight::SEMIBOLD, |
| 3891 UNDERLINE_MASK | STRIKE_MASK)); |
| 3892 expected_word_1.attributes.push_back(CreateRangedAttribute( |
| 3893 font_spans, 1, kWordOneStartIndex + 1, Font::Weight::NORMAL, |
| 3894 UNDERLINE_MASK | ITALIC_MASK | STRIKE_MASK)); |
| 3895 const Rect left_glyph_word_1 = render_text->GetCursorBounds( |
| 3896 SelectionModel(kWordOneStartIndex, CURSOR_FORWARD), false); |
| 3897 |
| 3898 DecoratedText expected_word_2; |
| 3899 expected_word_2.text = ASCIIToUTF16("c"); |
| 3900 // Attributes for character 'c' at logical index |kWordTwoStartIndex|. |
| 3901 expected_word_2.attributes.push_back(CreateRangedAttribute( |
| 3902 font_spans, 0, kWordTwoStartIndex, Font::Weight::NORMAL, |
| 3903 ITALIC_MASK | DIAGONAL_STRIKE_MASK | STRIKE_MASK)); |
| 3904 const Rect left_glyph_word_2 = render_text->GetCursorBounds( |
| 3905 SelectionModel(kWordTwoStartIndex, CURSOR_FORWARD), false); |
| 3906 |
| 3907 DecoratedText decorated_word; |
| 3908 Point baseline_point; |
| 3909 |
| 3910 { |
| 3911 SCOPED_TRACE(base::StringPrintf("Query to the left of text bounds")); |
| 3912 EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( |
| 3913 Point(-5, 5), &decorated_word, &baseline_point)); |
| 3914 VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); |
| 3915 EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); |
| 3916 } |
| 3917 { |
| 3918 SCOPED_TRACE(base::StringPrintf("Query to the right of text bounds")); |
| 3919 EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( |
| 3920 Point(105, 5), &decorated_word, &baseline_point)); |
| 3921 VerifyDecoratedWordsAreEqual(expected_word_2, decorated_word); |
| 3922 EXPECT_TRUE(left_glyph_word_2.Contains(baseline_point)); |
| 3923 } |
| 3924 |
| 3925 for (size_t i = 0; i < render_text->text().length(); i++) { |
| 3926 SCOPED_TRACE(base::StringPrintf("Case[%" PRIuS "]", i)); |
| 3927 // Query the decorated word using the origin of the i'th glyph's bounds. |
| 3928 const Point query = |
| 3929 render_text->GetCursorBounds(SelectionModel(i, CURSOR_FORWARD), false) |
| 3930 .origin(); |
| 3931 |
| 3932 EXPECT_TRUE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, |
| 3933 &baseline_point)); |
| 3934 |
| 3935 if (i < kWordTwoStartIndex) { |
| 3936 VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); |
| 3937 EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); |
| 3938 } else { |
| 3939 VerifyDecoratedWordsAreEqual(expected_word_2, decorated_word); |
| 3940 EXPECT_TRUE(left_glyph_word_2.Contains(baseline_point)); |
| 3941 } |
| 3942 } |
| 3943 } |
| 3944 |
| 3945 // Verify GetDecoratedWordAtPoint returns the correct baseline point and |
| 3946 // decorated word for an RTL string. |
| 3947 TEST_P(RenderTextHarfBuzzTest, GetDecoratedWordAtPoint_RTL) { |
| 3948 const base::string16 rtl = WideToUTF16( |
| 3949 L" " |
| 3950 L"\x0634\x0632" |
| 3951 L" " |
| 3952 L"\x0634"); |
| 3953 const int kWordOneStartIndex = 1; |
| 3954 const int kWordTwoStartIndex = 5; |
| 3955 |
| 3956 RenderText* render_text = GetRenderText(); |
| 3957 render_text->SetDisplayRect(Rect(100, 30)); |
| 3958 render_text->SetText(rtl); |
| 3959 render_text->ApplyWeight(Font::Weight::SEMIBOLD, Range(2, 3)); |
| 3960 render_text->ApplyStyle(UNDERLINE, true, Range(3, 6)); |
| 3961 render_text->ApplyStyle(ITALIC, true, Range(0, 3)); |
| 3962 render_text->ApplyStyle(DIAGONAL_STRIKE, true, Range(0, 2)); |
| 3963 render_text->ApplyStyle(STRIKE, true, Range(2, 5)); |
| 3964 |
| 3965 const std::vector<RenderText::FontSpan> font_spans = |
| 3966 render_text->GetFontSpansForTesting(); |
| 3967 |
| 3968 // Create expected decorated text instance. |
| 3969 DecoratedText expected_word_1; |
| 3970 expected_word_1.text = WideToUTF16(L"\x0634\x0632"); |
| 3971 // Attributes for characters at logical indices 1 and 2. |
| 3972 expected_word_1.attributes.push_back(CreateRangedAttribute( |
| 3973 font_spans, 0, kWordOneStartIndex, Font::Weight::NORMAL, |
| 3974 ITALIC_MASK | DIAGONAL_STRIKE_MASK)); |
| 3975 expected_word_1.attributes.push_back( |
| 3976 CreateRangedAttribute(font_spans, 1, kWordOneStartIndex + 1, |
| 3977 Font::Weight::SEMIBOLD, ITALIC_MASK | STRIKE_MASK)); |
| 3978 // The leftmost glyph is the one at logical index 2. |
| 3979 const Rect left_glyph_word_1 = render_text->GetCursorBounds( |
| 3980 SelectionModel(kWordOneStartIndex + 1, CURSOR_FORWARD), false); |
| 3981 |
| 3982 DecoratedText expected_word_2; |
| 3983 expected_word_2.text = WideToUTF16(L"\x0634"); |
| 3984 // Attributes for character at logical index |kWordTwoStartIndex|. |
| 3985 expected_word_2.attributes.push_back(CreateRangedAttribute( |
| 3986 font_spans, 0, kWordTwoStartIndex, Font::Weight::NORMAL, UNDERLINE_MASK)); |
| 3987 const Rect left_glyph_word_2 = render_text->GetCursorBounds( |
| 3988 SelectionModel(kWordTwoStartIndex, CURSOR_FORWARD), false); |
| 3989 |
| 3990 DecoratedText decorated_word; |
| 3991 Point baseline_point; |
| 3992 |
| 3993 { |
| 3994 SCOPED_TRACE(base::StringPrintf("Query to the left of text bounds")); |
| 3995 EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( |
| 3996 Point(-5, 5), &decorated_word, &baseline_point)); |
| 3997 VerifyDecoratedWordsAreEqual(expected_word_2, decorated_word); |
| 3998 EXPECT_TRUE(left_glyph_word_2.Contains(baseline_point)); |
| 3999 } |
| 4000 { |
| 4001 SCOPED_TRACE(base::StringPrintf("Query to the right of text bounds")); |
| 4002 EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( |
| 4003 Point(105, 5), &decorated_word, &baseline_point)); |
| 4004 VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); |
| 4005 EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); |
| 4006 } |
| 4007 |
| 4008 for (size_t i = 0; i < render_text->text().length(); i++) { |
| 4009 SCOPED_TRACE(base::StringPrintf("Case[%" PRIuS "]", i)); |
| 4010 |
| 4011 // Query the decorated word using the top right point of the i'th glyph's |
| 4012 // bounds. |
| 4013 const Point query = |
| 4014 render_text->GetCursorBounds(SelectionModel(i, CURSOR_FORWARD), false) |
| 4015 .top_right(); |
| 4016 |
| 4017 EXPECT_TRUE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, |
| 4018 &baseline_point)); |
| 4019 if (i < kWordTwoStartIndex) { |
| 4020 VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); |
| 4021 EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); |
| 4022 } else { |
| 4023 VerifyDecoratedWordsAreEqual(expected_word_2, decorated_word); |
| 4024 EXPECT_TRUE(left_glyph_word_2.Contains(baseline_point)); |
| 4025 } |
| 4026 } |
| 4027 } |
| 4028 |
| 4029 // Verify the boolean return value of GetDecoratedWordAtPoint. |
| 4030 TEST_P(RenderTextHarfBuzzTest, GetDecoratedWordAtPoint_Return) { |
| 4031 RenderText* render_text = GetRenderText(); |
| 4032 render_text->SetText(ASCIIToUTF16("...")); |
| 4033 |
| 4034 DecoratedText decorated_word; |
| 4035 Point baseline_point; |
| 4036 |
| 4037 // False should be returned, when the text does not contain any word. |
| 4038 Point query = |
| 4039 render_text->GetCursorBounds(SelectionModel(0, CURSOR_FORWARD), false) |
| 4040 .origin(); |
| 4041 EXPECT_FALSE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, |
| 4042 &baseline_point)); |
| 4043 |
| 4044 render_text->SetText(ASCIIToUTF16("abc")); |
| 4045 query = render_text->GetCursorBounds(SelectionModel(0, CURSOR_FORWARD), false) |
| 4046 .origin(); |
| 4047 EXPECT_TRUE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, |
| 4048 &baseline_point)); |
| 4049 |
| 4050 // False should be returned for obscured text. |
| 4051 render_text->SetObscured(true); |
| 4052 query = render_text->GetCursorBounds(SelectionModel(0, CURSOR_FORWARD), false) |
| 4053 .origin(); |
| 4054 EXPECT_FALSE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, |
| 4055 &baseline_point)); |
| 4056 } |
| 4057 |
3789 // Prefix for test instantiations intentionally left blank since each test | 4058 // Prefix for test instantiations intentionally left blank since each test |
3790 // fixture class has a single parameterization. | 4059 // fixture class has a single parameterization. |
3791 #if defined(OS_MACOSX) | 4060 #if defined(OS_MACOSX) |
3792 INSTANTIATE_TEST_CASE_P(, | 4061 INSTANTIATE_TEST_CASE_P(, |
3793 RenderTextTest, | 4062 RenderTextTest, |
3794 ::testing::Values(RENDER_TEXT_HARFBUZZ, | 4063 ::testing::Values(RENDER_TEXT_HARFBUZZ, |
3795 RENDER_TEXT_MAC), | 4064 RENDER_TEXT_MAC), |
3796 PrintRenderTextBackend()); | 4065 PrintRenderTextBackend()); |
3797 INSTANTIATE_TEST_CASE_P(, | 4066 INSTANTIATE_TEST_CASE_P(, |
3798 RenderTextMacTest, | 4067 RenderTextMacTest, |
3799 ::testing::Values(RENDER_TEXT_MAC), | 4068 ::testing::Values(RENDER_TEXT_MAC), |
3800 PrintRenderTextBackend()); | 4069 PrintRenderTextBackend()); |
3801 #else | 4070 #else |
3802 INSTANTIATE_TEST_CASE_P(, | 4071 INSTANTIATE_TEST_CASE_P(, |
3803 RenderTextTest, | 4072 RenderTextTest, |
3804 ::testing::Values(RENDER_TEXT_HARFBUZZ), | 4073 ::testing::Values(RENDER_TEXT_HARFBUZZ), |
3805 PrintRenderTextBackend()); | 4074 PrintRenderTextBackend()); |
3806 #endif | 4075 #endif |
3807 | 4076 |
3808 INSTANTIATE_TEST_CASE_P(, | 4077 INSTANTIATE_TEST_CASE_P(, |
3809 RenderTextHarfBuzzTest, | 4078 RenderTextHarfBuzzTest, |
3810 ::testing::Values(RENDER_TEXT_HARFBUZZ), | 4079 ::testing::Values(RENDER_TEXT_HARFBUZZ), |
3811 PrintRenderTextBackend()); | 4080 PrintRenderTextBackend()); |
3812 | 4081 |
3813 } // namespace gfx | 4082 } // namespace gfx |
OLD | NEW |