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

Commit 2c33e308 authored by Teng-Hui Zhu's avatar Teng-Hui Zhu
Browse files

Double check the layout test running on UI thread

Change-Id: I7628040868ab1cc047c2f891d91c88ab01815c9d
parent 2906c208
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);