Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaperTest.cpp

Issue 2614883007: Change computed style enums to be prefixed with 'k'. (Closed)
Patch Set: Rebase on ToT. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "platform/fonts/CharacterRange.h" 7 #include "platform/fonts/CharacterRange.h"
8 #include "platform/fonts/FontCache.h" 8 #include "platform/fonts/FontCache.h"
9 #include "platform/fonts/GlyphBuffer.h" 9 #include "platform/fonts/GlyphBuffer.h"
10 #include "platform/fonts/shaping/CachingWordShapeIterator.h" 10 #include "platform/fonts/shaping/CachingWordShapeIterator.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 ASSERT_EQ(referenceGlyphBuffer.glyphAt(1), glyphBuffer.glyphAt(1)); 131 ASSERT_EQ(referenceGlyphBuffer.glyphAt(1), glyphBuffer.glyphAt(1));
132 ASSERT_EQ(referenceGlyphBuffer.glyphAt(2), glyphBuffer.glyphAt(2)); 132 ASSERT_EQ(referenceGlyphBuffer.glyphAt(2), glyphBuffer.glyphAt(2));
133 } 133 }
134 134
135 // Tests that filling a glyph buffer for a specific range returns the same 135 // Tests that filling a glyph buffer for a specific range returns the same
136 // results when shaping word by word as when shaping the full run in one go. 136 // results when shaping word by word as when shaping the full run in one go.
137 TEST_F(CachingWordShaperTest, CommonAccentRightToLeftFillGlyphBuffer) { 137 TEST_F(CachingWordShaperTest, CommonAccentRightToLeftFillGlyphBuffer) {
138 // "[] []" with an accent mark over the last square bracket. 138 // "[] []" with an accent mark over the last square bracket.
139 const UChar str[] = {0x5B, 0x5D, 0x20, 0x5B, 0x301, 0x5D, 0x0}; 139 const UChar str[] = {0x5B, 0x5D, 0x20, 0x5B, 0x301, 0x5D, 0x0};
140 TextRun textRun(str, 6); 140 TextRun textRun(str, 6);
141 textRun.setDirection(TextDirection::Rtl); 141 textRun.setDirection(TextDirection::kRtl);
142 142
143 CachingWordShaper shaper(cache.get()); 143 CachingWordShaper shaper(cache.get());
144 GlyphBuffer glyphBuffer; 144 GlyphBuffer glyphBuffer;
145 shaper.fillGlyphBuffer(&font, textRun, fallbackFonts, &glyphBuffer, 1, 6); 145 shaper.fillGlyphBuffer(&font, textRun, fallbackFonts, &glyphBuffer, 1, 6);
146 146
147 std::unique_ptr<ShapeCache> referenceCache = WTF::makeUnique<ShapeCache>(); 147 std::unique_ptr<ShapeCache> referenceCache = WTF::makeUnique<ShapeCache>();
148 CachingWordShaper referenceShaper(referenceCache.get()); 148 CachingWordShaper referenceShaper(referenceCache.get());
149 GlyphBuffer referenceGlyphBuffer; 149 GlyphBuffer referenceGlyphBuffer;
150 font.setCanShapeWordByWordForTesting(false); 150 font.setCanShapeWordByWordForTesting(false);
151 referenceShaper.fillGlyphBuffer(&font, textRun, fallbackFonts, 151 referenceShaper.fillGlyphBuffer(&font, textRun, fallbackFonts,
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // The total width of periods and spaces should be longer than the width of 468 // The total width of periods and spaces should be longer than the width of
469 // periods alone. 469 // periods alone.
470 ASSERT_GT(periodsAndSpacesWidth, periodsWidth); 470 ASSERT_GT(periodsAndSpacesWidth, periodsWidth);
471 471
472 // The glyph bounds of periods and spaces should be longer than the glyph 472 // The glyph bounds of periods and spaces should be longer than the glyph
473 // bounds of periods alone. 473 // bounds of periods alone.
474 ASSERT_GT(periodsAndSpacesGlyphBounds.width(), periodsGlyphBounds.width()); 474 ASSERT_GT(periodsAndSpacesGlyphBounds.width(), periodsGlyphBounds.width());
475 } 475 }
476 476
477 } // namespace blink 477 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/Font.cpp ('k') | third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698