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

Commit 74ccec25 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Move ActivityManager tests to WmTests

Bug: 113800711
Test: Pass all AM presubmit tests in WmTests
  $ tradefed.sh run commandAndExit WmTests \
      --include-filter com.android.server.am. \
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
Change-Id: Idc2dc9e80d95cfe8490ddef94aeca9a5202aad91
parent 5f106c8e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -171,6 +171,11 @@ class PersisterQueue {
        mListeners.add(listener);
    }

    @VisibleForTesting
    boolean removeListener(Listener listener) {
        return mListeners.remove(listener);
    }

    private void processNextItem() throws InterruptedException {
        // This part is extracted into a method so that the GC can clearly see the end of the
        // scope of the variable 'item'.  If this part was in the loop in LazyTaskWriterThread, the
+1 −1
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ public class TestHandler extends Handler {

        @Override
        public int compareTo(MsgInfo o) {
            return (int) (sendTime - o.sendTime);
            return Long.compare(sendTime, o.sendTime);
        }

        @Override
+7 −1
Original line number Diff line number Diff line
@@ -11,12 +11,18 @@ LOCAL_MODULE_TAGS := tests
# Include all test java files.
LOCAL_SRC_FILES := \
    $(call all-java-files-under, src) \
    $(call all-java-files-under, ../servicestests/utils)
    $(call all-java-files-under, ../servicestests/utils) \

LOCAL_STATIC_JAVA_LIBRARIES := \
    frameworks-base-testutils \
    services.core \
    androidx.test.runner \
    androidx.test.rules \
    mockito-target-minus-junit4 \
    platform-test-annotations \
    truth-prebuilt \
    testables \
    ub-uiautomator \

LOCAL_JAVA_LIBRARIES := \
    android.test.mock \
+15 −1
Original line number Diff line number Diff line
@@ -22,7 +22,21 @@
        android:minSdkVersion="1"
        android:targetSdkVersion="28" />

    <application android:testOnly="true" />
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
    <uses-permission android:name="android.permission.MANAGE_ACTIVITY_STACKS" />
    <uses-permission android:name="android.permission.GET_TOP_ACTIVITY_INFO" />
    <uses-permission android:name="android.permission.MANAGE_USERS" />
    <uses-permission android:name="android.permission.STORAGE_INTERNAL" />
    <uses-permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE" />

    <application android:testOnly="true">
        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityA" />
        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityB" />
        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityRequestedOrientationChange" />
        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskChangeCallbacks" />
        <activity android:name="com.android.server.am.TaskStackChangedListenerTest$ActivityTaskDescriptionChange" />
    </application>

    <instrumentation
        android:name="androidx.test.runner.AndroidJUnitRunner"
+0 −5
Original line number Diff line number Diff line
@@ -32,11 +32,9 @@ import static org.mockito.Mockito.doReturn;
import android.platform.test.annotations.Presubmit;

import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
 * Tests for the {@link ActivityDisplay} class.
@@ -46,13 +44,10 @@ import org.junit.runner.RunWith;
 */
@SmallTest
@Presubmit
@RunWith(AndroidJUnit4.class)
public class ActivityDisplayTests extends ActivityTestsBase {

    @Before
    @Override
    public void setUp() throws Exception {
        super.setUp();
        setupActivityTaskManagerService();
    }

Loading