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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 <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/GlyphBuffer.h" 10 #include "platform/fonts/GlyphBuffer.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 424
425 ASSERT_TRUE(iterator.next(&wordResult)); 425 ASSERT_TRUE(iterator.next(&wordResult));
426 EXPECT_EQ(2u, wordResult->numCharacters()); 426 EXPECT_EQ(2u, wordResult->numCharacters());
427 427
428 ASSERT_FALSE(iterator.next(&wordResult)); 428 ASSERT_FALSE(iterator.next(&wordResult));
429 } 429 }
430 430
431 TEST_F(CachingWordShaperTest, TextOrientationFallbackShouldNotInFallbackList) { 431 TEST_F(CachingWordShaperTest, TextOrientationFallbackShouldNotInFallbackList) {
432 const UChar str[] = { 432 const UChar str[] = {
433 'A', // code point for verticalRightOrientationFontData() 433 'A', // code point for verticalRightOrientationFontData()
434 // Ideally we'd like to test uprightOrientationFontData() too 434 // Ideally we'd like to test uprightOrientationFontData() too
435 // using code point such as U+3042, but it'd fallback to system 435 // using code point such as U+3042, but it'd fallback to system
436 // fonts as the glyph is missing. 436 // fonts as the glyph is missing.
437 0x0}; 437 0x0};
438 TextRun textRun(str, 1); 438 TextRun textRun(str, 1);
439 439
440 fontDescription.setOrientation(FontOrientation::VerticalMixed); 440 fontDescription.setOrientation(FontOrientation::VerticalMixed);
441 Font verticalMixedFont = Font(fontDescription); 441 Font verticalMixedFont = Font(fontDescription);
442 verticalMixedFont.update(nullptr); 442 verticalMixedFont.update(nullptr);
443 ASSERT_TRUE(verticalMixedFont.canShapeWordByWord()); 443 ASSERT_TRUE(verticalMixedFont.canShapeWordByWord());
444 444
445 CachingWordShaper shaper(cache.get()); 445 CachingWordShaper shaper(cache.get());
446 FloatRect glyphBounds; 446 FloatRect glyphBounds;
(...skipping 21 matching lines...) Expand all
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

Powered by Google App Engine
This is Rietveld 408576698