Merge "Rename WM test filter to FrameworksTestsFilter"

This commit is contained in:
Treehugger Robot
2019-03-26 17:32:22 +00:00
committed by Gerrit Code Review
26 changed files with 242 additions and 89 deletions

View File

@@ -29,6 +29,15 @@ import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Tests for {@link ClientTransaction}.
*
* <p>Build/Install/Run:
* atest FrameworksCoreTests:ClientTransactionTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
@Presubmit

View File

@@ -41,6 +41,15 @@ import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Tests for {@link ObjectPool}.
*
* <p>Build/Install/Run:
* atest FrameworksCoreTests:ObjectPoolTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
@Presubmit

View File

@@ -26,9 +26,8 @@ import static android.app.servertransaction.ActivityLifecycleItem.ON_STOP;
import static android.app.servertransaction.ActivityLifecycleItem.PRE_ON_CREATE;
import static android.app.servertransaction.ActivityLifecycleItem.UNDEFINED;
import static junit.framework.Assert.assertEquals;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.inOrder;
@@ -58,7 +57,15 @@ import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/** Test {@link TransactionExecutor} logic. */
/**
* Test {@link TransactionExecutor} logic.
*
* <p>Build/Install/Run:
* atest FrameworksCoreTests:TransactionExecutorTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
@Presubmit

View File

@@ -21,8 +21,8 @@ import static android.app.servertransaction.TestUtils.mergedConfig;
import static android.app.servertransaction.TestUtils.referrerIntentList;
import static android.app.servertransaction.TestUtils.resultInfoList;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import android.app.IApplicationThread;
import android.app.IInstrumentationWatcher;
@@ -60,7 +60,15 @@ import org.junit.runner.RunWith;
import java.util.List;
import java.util.Map;
/** Test parcelling and unparcelling of transactions and transaction items. */
/**
* Test parcelling and unparcelling of transactions and transaction items.
*
* <p>Build/Install/Run:
* atest FrameworksCoreTests:TransactionParcelTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
@Presubmit

View File

@@ -40,6 +40,15 @@ import org.junit.runner.RunWith;
import java.util.Arrays;
/**
* Tests for {@link DisplayCutout}.
*
* <p>Build/Install/Run:
* atest FrameworksCoreTests:DisplayCutoutTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
@Presubmit

View File

@@ -43,8 +43,11 @@ import org.junit.runner.RunWith;
/**
* Tests for exercising resizing bounds due to activity options.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:ActivityLaunchParamsModifierTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit

View File

@@ -30,16 +30,15 @@ import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_BOTTOM;
import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_LEFT;
import static com.android.server.policy.WindowManagerPolicy.NAV_BAR_RIGHT;
import static junit.framework.TestCase.assertNotNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -62,8 +61,11 @@ import org.mockito.invocation.InvocationOnMock;
/**
* Tests for the {@link ActivityRecord} class.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:com.android.server.am.ActivityRecordTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit

View File

@@ -27,15 +27,14 @@ import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE;
import static android.content.pm.ActivityInfo.FLAG_SHOW_WHEN_LOCKED;
import static com.android.server.am.ActivityStack.REMOVE_TASK_MODE_DESTROYING;
import static com.android.server.am.ActivityStackSupervisor
.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE;
import static com.android.server.am.ActivityStackSupervisor.MATCH_TASK_IN_STACKS_OR_RECENT_TASKS_AND_RESTORE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
@@ -62,8 +61,11 @@ import java.util.ArrayList;
/**
* Tests for the {@link ActivityStackSupervisor} class.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:com.android.server.am.ActivityStackSupervisorTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit

View File

@@ -33,7 +33,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.anyInt;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
@@ -51,8 +51,11 @@ import org.junit.runner.RunWith;
/**
* Tests for the {@link ActivityStack} class.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:com.android.server.am.ActivityStackTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@SmallTest
@Presubmit

View File

@@ -19,8 +19,8 @@ package com.android.server.am;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
@@ -43,8 +43,11 @@ import java.util.Random;
/**
* Tests for the {@link ActivityStartController} class.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:ActivityStartControllerTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@SmallTest
@Presubmit

View File

@@ -55,8 +55,11 @@ import org.mockito.MockitoAnnotations;
/**
* Unit tests for {@link ActivityStartInterceptorTest}.
*
* Build/Install/Run:
* bit FrameworksServicesTests:com.android.server.am.ActivityStartInterceptorTest
* <p>Build/Install/Run:
* atest FrameworksServicesTests:ActivityStartInterceptorTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@SmallTest
public class ActivityStartInterceptorTest {

View File

@@ -39,14 +39,14 @@ import static com.android.server.am.ActivityManagerService.ANIMATE;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.anyObject;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyObject;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
@@ -80,8 +80,11 @@ import org.junit.runner.RunWith;
/**
* Tests for the {@link ActivityStarter} class.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:ActivityStarterTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@SmallTest
@Presubmit

View File

@@ -64,7 +64,11 @@ import java.util.concurrent.TimeUnit;
* Note: Currently, we only support fetching the screenshot for the current application, so the
* screenshot checks are hardcoded accordingly.
*
* runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/AssistDataRequesterTest.java
* <p>Build/Install/Run:
* atest FrameworksServicesTests:AssistDataRequesterTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@FlakyTest(bugId = 113616538)

View File

@@ -16,6 +16,15 @@ import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Tests for {@link ClientLifecycleManager}.
*
* <p>Build/Install/Run:
* atest FrameworksServicesTests:ClientLifecycleManagerTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
@Presubmit

View File

@@ -24,10 +24,10 @@ import static com.android.server.am.LaunchParamsController.LaunchParamsModifier.
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
@@ -51,8 +51,11 @@ import org.junit.runner.RunWith;
/**
* Tests for exercising {@link LaunchParamsController}.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:LaunchParamsControllerTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit

View File

@@ -38,7 +38,13 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
/**
* atest PendingRemoteAnimationRegistryTest
* Tests for {@link PendingRemoteAnimationRegistry}.
*
* <p>Build/Install/Run:
* atest PendingRemoteAnimationRegistryTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@SmallTest
@Presubmit

View File

@@ -76,7 +76,13 @@ import java.util.Random;
import java.util.Set;
/**
* atest FrameworksServicesTests:RecentTasksTest
* Tests for {@link RecentTasks}.
*
* <p>Build/Install/Run:
* atest FrameworksServicesTests:RecentTasksTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit

View File

@@ -22,9 +22,9 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static com.android.server.wm.RecentsAnimationController.REORDER_KEEP_IN_PLACE;
import static org.mockito.Mockito.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -46,7 +46,13 @@ import org.junit.Test;
import org.junit.runner.RunWith;
/**
* atest FrameworksServicesTests:RecentsAnimationTest
* Tests for recent tasks animation.
*
* <p>Build/Install/Run:
* atest FrameworksServicesTests:RecentsAnimationTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit

View File

@@ -43,7 +43,13 @@ import org.junit.runner.RunWith;
import java.util.ArrayList;
/**
* runtest --path frameworks/base/services/tests/servicestests/src/com/android/server/am/RunningTasksTest.java
* Tests for {@link RunningTasks}.
*
* <p>Build/Install/Run:
* atest FrameworksServicesTests:RunningTasksTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit
@@ -124,4 +130,4 @@ public class RunningTasksTest extends ActivityTestsBase {
.build();
return task;
}
}
}

View File

@@ -28,6 +28,15 @@ import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
/**
* Tests for {@link SafeActivityOptions}.
*
* <p>Build/Install/Run:
* atest FrameworksServicesTests:SafeActivityOptionsTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit
@FlakyTest

View File

@@ -38,8 +38,11 @@ import org.junit.runner.RunWith;
/**
* Tests for exercising resizing task bounds.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:TaskLaunchParamsModifierTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit

View File

@@ -30,7 +30,13 @@ import java.io.File;
import java.util.Random;
/**
* atest FrameworksServicesTests:TaskPersisterTest
* Tests for {@link TaskPersister}.
*
* <p>Build/Install/Run:
* atest FrameworksServicesTests:TaskPersisterTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
public class TaskPersisterTest extends AndroidTestCase {
private static final String TEST_USER_NAME = "AM-Test-User";
@@ -85,4 +91,4 @@ public class TaskPersisterTest extends AndroidTestCase {
fail("Error while removing the test user: " + TEST_USER_NAME);
}
}
}
}

View File

@@ -59,8 +59,11 @@ import java.util.ArrayList;
/**
* Tests for exercising {@link TaskRecord}.
*
* Build/Install/Run:
* <p>Build/Install/Run:
* atest FrameworksServicesTests:com.android.server.am.TaskRecordTests
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@Presubmit

View File

@@ -52,6 +52,15 @@ import org.junit.runner.RunWith;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/**
* Tests for {@link TaskStackListener}.
*
* <p>Build/Install/Run:
* atest FrameworksServicesTests:TaskStackChangedListenerTest
*
* <p>This test class is a part of Window Manager Service tests and specified in
* {@link com.android.server.wm.test.filters.FrameworksTestsFilter}.
*/
@MediumTest
@RunWith(AndroidJUnit4.class)
public class TaskStackChangedListenerTest {

View File

@@ -1,44 +0,0 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.server.wm.test.filters;
import android.os.Bundle;
import com.android.test.filters.SelectTest;
/**
* JUnit test filter that select Window Manager Service related tests from FrameworksCoreTests.
*
* <p>Use this filter when running FrameworksCoreTests as
* <pre>
* adb shell am instrument -w \
* -e filter com.android.server.wm.test.filters.CoreTestsFilter \
* -e selectTest_verbose true \
* com.android.frameworks.coretests/androidx.test.runner.AndroidJUnitRunner
* </pre>
*/
public final class CoreTestsFilter extends SelectTest {
private static final String[] SELECTED_CORE_TESTS = {
"android.app.servertransaction.", // all tests under the package.
"android.view.DisplayCutoutTest",
};
public CoreTestsFilter(Bundle testArgs) {
super(addSelectTest(testArgs, SELECTED_CORE_TESTS));
}
}

View File

@@ -0,0 +1,66 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.server.wm.test.filters;
import android.os.Bundle;
import com.android.test.filters.SelectTest;
/**
* JUnit test filter that select Window Manager Service related tests from FrameworksCoreTests.
*
* <p>Use this filter when running FrameworksCoreTests as
* <pre>
* adb shell am instrument -w \
* -e filter com.android.server.wm.test.filters.FrameworksTestsFilter \
* -e selectTest_verbose true \
* com.android.frameworks.coretests/androidx.test.runner.AndroidJUnitRunner
* </pre>
*/
public final class FrameworksTestsFilter extends SelectTest {
private static final String[] SELECTED_TESTS = {
// Test specifications for FrameworksCoreTests.
"android.app.servertransaction.", // all tests under the package.
"android.view.DisplayCutoutTest",
// Test specifications for FrameworksServicesTests.
"com.android.server.policy.", // all tests under the package.
"com.android.server.am.ActivityLaunchParamsModifierTests",
"com.android.server.am.ActivityRecordTests",
"com.android.server.am.ActivityStackSupervisorTests",
"com.android.server.am.ActivityStackTests",
"com.android.server.am.ActivityStartControllerTests",
"com.android.server.am.ActivityStarterTests",
"com.android.server.am.ActivityStartInterceptorTest",
"com.android.server.am.AssistDataRequesterTest",
"com.android.server.am.ClientLifecycleManagerTests",
"com.android.server.am.LaunchParamsControllerTests",
"com.android.server.am.PendingRemoteAnimationRegistryTest",
"com.android.server.am.RecentsAnimationTest",
"com.android.server.am.RecentTasksTest",
"com.android.server.am.RunningTasksTest",
"com.android.server.am.SafeActivityOptionsTest",
"com.android.server.am.TaskLaunchParamsModifierTests",
"com.android.server.am.TaskPersisterTest",
"com.android.server.am.TaskRecordTests",
"com.android.server.am.TaskStackChangedListenerTest",
};
public FrameworksTestsFilter(Bundle testArgs) {
super(addSelectTest(testArgs, SELECTED_TESTS));
}
}