Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1debe9a3 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Add test case for different text direction.

Bug: 113635044
Test: StaticLayoutPerfTest
Change-Id: I74f42bfc25aff25bfc1783ad0977b92526c87ef6
parent 4445345f
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -168,6 +168,25 @@ public class StaticLayoutPerfTest {
        }
    }

    @Test
    public void testCreate_PrecomputedText_NoStyled_Greedy_NoHyphenation_DirDifferent() {
        final BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        while (state.keepRunning()) {
            state.pauseTiming();
            final PrecomputedText text = makeMeasured(
                    mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT), PAINT,
                    Layout.BREAK_STRATEGY_SIMPLE, Layout.HYPHENATION_FREQUENCY_NONE);
            Canvas.freeTextLayoutCaches();
            state.resumeTiming();

            StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH)
                    .setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE)
                    .setBreakStrategy(Layout.BREAK_STRATEGY_SIMPLE)
                    .setTextDirection(TextDirectionHeuristics.RTL)
                    .build();
        }
    }

    @Test
    public void testCreate_PrecomputedText_NoStyled_Greedy_Hyphenation() {
        final BenchmarkState state = mPerfStatusReporter.getBenchmarkState();