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

Commit d489d7f6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Ic0304c29,I7fdb41aa

* changes:
  Add trace based window manager perf test
  Rename StubActivity to PerfTestActivity
parents 6bc75fcb f5622d25
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -20,9 +20,9 @@ import static org.junit.Assert.assertTrue;

import android.os.Looper;
import android.perftests.utils.PerfStatusReporter;
import android.perftests.utils.PerfTestActivity;
import android.perftests.utils.SettingsHelper;
import android.perftests.utils.SettingsStateKeeperRule;
import android.perftests.utils.StubActivity;
import android.provider.Settings;

import androidx.test.InstrumentationRegistry;
@@ -46,8 +46,8 @@ public abstract class AbstractAutofillPerfTestCase {
                    Settings.Secure.AUTOFILL_SERVICE);

    @Rule
    public ActivityTestRule<StubActivity> mActivityRule =
            new ActivityTestRule<StubActivity>(StubActivity.class);
    public ActivityTestRule<PerfTestActivity> mActivityRule =
            new ActivityTestRule<>(PerfTestActivity.class);

    @Rule
    public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
@@ -68,7 +68,7 @@ public abstract class AbstractAutofillPerfTestCase {
                    Looper.getMainLooper().getThread() == Thread.currentThread());
            assertTrue("We should be running on the main thread",
                    Looper.myLooper() == Looper.getMainLooper());
            StubActivity activity = mActivityRule.getActivity();
            PerfTestActivity activity = mActivityRule.getActivity();
            activity.setContentView(mLayoutId);
            onCreate(activity);
        });
@@ -89,9 +89,9 @@ public abstract class AbstractAutofillPerfTestCase {
    }

    /**
     * Initializes the {@link StubActivity} after it was launched.
     * Initializes the {@link PerfTestActivity} after it was launched.
     */
    protected abstract void onCreate(StubActivity activity);
    protected abstract void onCreate(PerfTestActivity activity);

    /**
     * Uses the {@code settings} binary to set the autofill service.
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import static android.view.autofill.AutofillManager.AutofillCallback.EVENT_INPUT
import static android.view.autofill.AutofillManager.AutofillCallback.EVENT_INPUT_SHOWN;

import android.perftests.utils.BenchmarkState;
import android.perftests.utils.StubActivity;
import android.perftests.utils.PerfTestActivity;
import android.view.View;
import android.widget.EditText;

@@ -39,7 +39,7 @@ public class LoginTest extends AbstractAutofillPerfTestCase {
    }

    @Override
    protected void onCreate(StubActivity activity) {
    protected void onCreate(PerfTestActivity activity) {
        View root = activity.getWindow().getDecorView();
        mUsername = root.findViewById(R.id.username);
        mPassword = root.findViewById(R.id.password);
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@

    <application>
        <uses-library android:name="android.test.runner" />
        <activity android:name="android.perftests.utils.StubActivity">
        <activity android:name="android.perftests.utils.PerfTestActivity">
          <intent-filter>
            <action android:name="com.android.perftests.core.PERFTEST" />
          </intent-filter>
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import android.content.Context;
import android.content.Intent;
import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;
import android.perftests.utils.StubActivity;
import android.perftests.utils.PerfTestActivity;

import androidx.test.InstrumentationRegistry;
import androidx.test.filters.LargeTest;
@@ -48,7 +48,7 @@ public class PendingIntentPerfTest {
    @Before
    public void setUp() {
        mContext = InstrumentationRegistry.getTargetContext();
        mIntent = StubActivity.createLaunchIntent(mContext);
        mIntent = PerfTestActivity.createLaunchIntent(mContext);
    }

    /**
+3 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ package android.graphics.perftests;
import android.graphics.Paint;
import android.perftests.utils.BenchmarkState;
import android.perftests.utils.PerfStatusReporter;
import android.perftests.utils.StubActivity;
import android.perftests.utils.PerfTestActivity;

import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
@@ -58,7 +58,8 @@ public class PaintHasGlyphPerfTest {
    }

    @Rule
    public ActivityTestRule<StubActivity> mActivityRule = new ActivityTestRule(StubActivity.class);
    public ActivityTestRule<PerfTestActivity> mActivityRule =
            new ActivityTestRule<>(PerfTestActivity.class);

    @Rule
    public PerfStatusReporter mPerfStatusReporter = new PerfStatusReporter();
Loading