| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "platform/fonts/shaping/HarfBuzzShaper.h" | 5 #include "platform/fonts/shaping/HarfBuzzShaper.h" |
| 6 | 6 |
| 7 #include "platform/fonts/Font.h" | 7 #include "platform/fonts/Font.h" |
| 8 #include "platform/fonts/FontCache.h" | 8 #include "platform/fonts/FontCache.h" |
| 9 #include "platform/fonts/shaping/ShapeResultTestInfo.h" | 9 #include "platform/fonts/shaping/ShapeResultTestInfo.h" |
| 10 #include "platform/text/TextRun.h" | 10 #include "platform/text/TextRun.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 EXPECT_EQ(1u, testInfo(result)->numberOfRunsForTesting()) << test.name; | 83 EXPECT_EQ(1u, testInfo(result)->numberOfRunsForTesting()) << test.name; |
| 84 ASSERT_TRUE( | 84 ASSERT_TRUE( |
| 85 testInfo(result)->runInfoForTesting(0, startIndex, numGlyphs, script)) | 85 testInfo(result)->runInfoForTesting(0, startIndex, numGlyphs, script)) |
| 86 << test.name; | 86 << test.name; |
| 87 EXPECT_EQ(0u, startIndex) << test.name; | 87 EXPECT_EQ(0u, startIndex) << test.name; |
| 88 if (numGlyphs == 2) { | 88 if (numGlyphs == 2) { |
| 89 // If the specified VS is not in the font, it's mapped to .notdef. | 89 // If the specified VS is not in the font, it's mapped to .notdef. |
| 90 // then hb_ot_hide_default_ignorables() swaps it to a space with zero-advance. | 90 // then hb_ot_hide_default_ignorables() swaps it to a space with zero-advance. |
| 91 // http://lists.freedesktop.org/archives/harfbuzz/2015-May/004888.html | 91 // http://lists.freedesktop.org/archives/harfbuzz/2015-May/004888.html |
| 92 // OpenType recommends Glyph ID 3 for a space; not a hard requirement though. | |
| 93 // https://www.microsoft.com/typography/otspec/recom.htm | |
| 94 #if !OS(MACOSX) | 92 #if !OS(MACOSX) |
| 95 // TODO(mgiuca): This expectation has been DISABLED due to failing on | 93 EXPECT_EQ(testInfo(result)->fontDataForTesting(0)->spaceGlyph(), |
| 96 // Linux bots. See https://crbug.com/667147. | 94 testInfo(result)->glyphForTesting(0, 1)) |
| 97 // EXPECT_EQ(3u, testInfo(result)->glyphForTesting(0, 1)) << test.name; | 95 << test.name; |
| 98 #endif | 96 #endif |
| 99 EXPECT_EQ(0.f, testInfo(result)->advanceForTesting(0, 1)) << test.name; | 97 EXPECT_EQ(0.f, testInfo(result)->advanceForTesting(0, 1)) << test.name; |
| 100 } else { | 98 } else { |
| 101 EXPECT_EQ(1u, numGlyphs) << test.name; | 99 EXPECT_EQ(1u, numGlyphs) << test.name; |
| 102 } | 100 } |
| 103 EXPECT_EQ(test.script, script) << test.name; | 101 EXPECT_EQ(test.script, script) << test.name; |
| 104 } | 102 } |
| 105 } | 103 } |
| 106 | 104 |
| 107 TEST_F(HarfBuzzShaperTest, ResolveCandidateRunsDevanagariCommon) { | 105 TEST_F(HarfBuzzShaperTest, ResolveCandidateRunsDevanagariCommon) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 202 |
| 205 ASSERT_EQ(1u, testInfo(result)->numberOfRunsForTesting()); | 203 ASSERT_EQ(1u, testInfo(result)->numberOfRunsForTesting()); |
| 206 ASSERT_TRUE( | 204 ASSERT_TRUE( |
| 207 testInfo(result)->runInfoForTesting(0, startIndex, numGlyphs, script)); | 205 testInfo(result)->runInfoForTesting(0, startIndex, numGlyphs, script)); |
| 208 EXPECT_EQ(0u, startIndex); | 206 EXPECT_EQ(0u, startIndex); |
| 209 EXPECT_EQ(3u, numGlyphs); | 207 EXPECT_EQ(3u, numGlyphs); |
| 210 EXPECT_EQ(HB_SCRIPT_ARABIC, script); | 208 EXPECT_EQ(HB_SCRIPT_ARABIC, script); |
| 211 } | 209 } |
| 212 | 210 |
| 213 } // namespace blink | 211 } // namespace blink |
| OLD | NEW |