| 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/CachingWordShaper.h" | 5 #include "platform/fonts/shaping/CachingWordShaper.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include "platform/fonts/CharacterRange.h" | 8 #include "platform/fonts/CharacterRange.h" |
| 9 #include "platform/fonts/FontCache.h" | 9 #include "platform/fonts/FontCache.h" |
| 10 #include "platform/fonts/shaping/CachingWordShapeIterator.h" | 10 #include "platform/fonts/shaping/CachingWordShapeIterator.h" |
| 11 #include "platform/fonts/shaping/ShapeResultTestInfo.h" | 11 #include "platform/fonts/shaping/ShapeResultTestInfo.h" |
| 12 #include "platform/wtf/PtrUtil.h" | 12 #include "platform/wtf/PtrUtil.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class CachingWordShaperTest : public ::testing::Test { | 17 class CachingWordShaperTest : public ::testing::Test { |
| 18 protected: | 18 protected: |
| 19 void SetUp() override { | 19 void SetUp() override { |
| 20 font_description.SetComputedSize(12.0); | 20 font_description.SetComputedSize(12.0); |
| 21 font_description.SetLocale(LayoutLocale::Get("en")); | 21 font_description.SetLocale(LayoutLocale::Get("en")); |
| 22 ASSERT_EQ(USCRIPT_LATIN, font_description.Script()); | 22 ASSERT_EQ(USCRIPT_LATIN, font_description.GetScript()); |
| 23 font_description.SetGenericFamily(FontDescription::kStandardFamily); | 23 font_description.SetGenericFamily(FontDescription::kStandardFamily); |
| 24 | 24 |
| 25 font = Font(font_description); | 25 font = Font(font_description); |
| 26 font.Update(nullptr); | 26 font.Update(nullptr); |
| 27 ASSERT_TRUE(font.CanShapeWordByWord()); | 27 ASSERT_TRUE(font.CanShapeWordByWord()); |
| 28 fallback_fonts = nullptr; | 28 fallback_fonts = nullptr; |
| 29 cache = WTF::MakeUnique<ShapeCache>(); | 29 cache = WTF::MakeUnique<ShapeCache>(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 FontCachePurgePreventer font_cache_purge_preventer; | 32 FontCachePurgePreventer font_cache_purge_preventer; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 // periods alone. | 479 // periods alone. |
| 480 ASSERT_GT(periods_and_spaces_width, periods_width); | 480 ASSERT_GT(periods_and_spaces_width, periods_width); |
| 481 | 481 |
| 482 // The glyph bounds of periods and spaces should be longer than the glyph | 482 // The glyph bounds of periods and spaces should be longer than the glyph |
| 483 // bounds of periods alone. | 483 // bounds of periods alone. |
| 484 ASSERT_GT(periods_and_spaces_glyph_bounds.Width(), | 484 ASSERT_GT(periods_and_spaces_glyph_bounds.Width(), |
| 485 periods_glyph_bounds.Width()); | 485 periods_glyph_bounds.Width()); |
| 486 } | 486 } |
| 487 | 487 |
| 488 } // namespace blink | 488 } // namespace blink |
| OLD | NEW |