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

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

Issue 2879093002: [LayoutNG] Fix ShapingLineBreaker when the end of range is needed (Closed)
Patch Set: Rebase Created 3 years, 6 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/ShapingLineBreaker.h" 5 #include "platform/fonts/shaping/ShapingLineBreaker.h"
6 6
7 #include <unicode/uscript.h> 7 #include <unicode/uscript.h>
8 #include "platform/fonts/Font.h" 8 #include "platform/fonts/Font.h"
9 #include "platform/fonts/FontCache.h" 9 #include "platform/fonts/FontCache.h"
10 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h" 10 #include "platform/fonts/shaping/ShapeResultInlineHeaders.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 TextDirection direction = TextDirection::kLtr; 236 TextDirection direction = TextDirection::kLtr;
237 237
238 HarfBuzzShaper shaper(string.Characters16(), string.length()); 238 HarfBuzzShaper shaper(string.Characters16(), string.length());
239 RefPtr<ShapeResult> result = shaper.Shape(&font, direction, 0, 2); 239 RefPtr<ShapeResult> result = shaper.Shape(&font, direction, 0, 2);
240 240
241 ShapingLineBreaker breaker(&shaper, &font, result.Get(), &break_iterator); 241 ShapingLineBreaker breaker(&shaper, &font, result.Get(), &break_iterator);
242 RefPtr<ShapeResult> line; 242 RefPtr<ShapeResult> line;
243 unsigned break_offset = 0; 243 unsigned break_offset = 0;
244 244
245 line = breaker.ShapeLine(0, LayoutUnit::Max(), &break_offset); 245 line = breaker.ShapeLine(0, LayoutUnit::Max(), &break_offset);
246 EXPECT_EQ(3u, break_offset); 246 EXPECT_EQ(2u, break_offset);
247 EXPECT_EQ(result->Width(), line->Width()); 247 EXPECT_EQ(result->Width(), line->Width());
248 } 248 }
249 } // namespace blink 249 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698