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

Commit 45e492de authored by Tenghui Zhu's avatar Tenghui Zhu Committed by Android (Google) Code Review
Browse files

Merge "Double check the layout test running on UI thread"

parents 2adc0c39 2c33e308
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.widget;

import android.app.Activity;
import android.os.Looper;
import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;
import android.perftests.utils.StubActivity;
@@ -42,6 +43,7 @@ import static android.perftests.utils.LayoutUtils.requestLayoutForAllNodes;
import static android.view.View.MeasureSpec.AT_MOST;
import static android.view.View.MeasureSpec.EXACTLY;
import static android.view.View.MeasureSpec.UNSPECIFIED;
import static org.junit.Assert.assertTrue;

@LargeTest
@RunWith(Parameterized.class)
@@ -77,6 +79,11 @@ public class LayoutPerfTest {
    @Test
    @UiThreadTest
    public void testLayoutPerf() {
        assertTrue("We should be running on the main thread",
                Looper.getMainLooper().getThread() == Thread.currentThread());
        assertTrue("We should be running on the main thread",
                Looper.myLooper() == Looper.getMainLooper());

        Activity activity = mActivityRule.getActivity();
        activity.setContentView(mLayoutId);