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

Commit f2829dee authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

StaticLayoutPerfTest: Use fixed seed in each test case

Bug: None
Test: run StaticLayoutPerfTest
Change-Id: I49610b8098d67097569091e18d87eafb9911049b
parent 633792e2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.graphics.Typeface;
import android.text.Layout;
import android.text.style.TextAppearanceSpan;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -52,7 +53,7 @@ public class StaticLayoutPerfTest {
    private static final boolean NO_STYLE_TEXT = false;
    private static final boolean STYLE_TEXT = true;

    private final Random mRandom = new Random(31415926535L);
    private Random mRandom;

    private static final String ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    private static final int ALPHABET_LENGTH = ALPHABET.length();
@@ -98,6 +99,11 @@ public class StaticLayoutPerfTest {
        return ssb;
    }

    @Before
    public void setUp() {
        mRandom = new Random(0);
    }

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